⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 signal.tex

📁 标准c库代码,可以应用于各个系统提供了大量的基本函数
💻 TEX
字号:
@node Signals@chapter Signal Handling (@file{signal.h})A @dfn{signal} is an event that interrupts the normal flow of controlin your program.  Your operating environment normally defines the fullset of signals available (see @file{sys/signal.h}), as well as thedefault means of dealing with them---typically, either printing anerror message and aborting your program, or ignoring the signal.All systems support at least the following signals:@table @code@item SIGABRTAbnormal termination of a program; raised by the <<abort>> function.@item SIGFPEA domain error in arithmetic, such as overflow, or division by zero.@item SIGILLAttempt to execute as a function data that is not executable.@item SIGINTInterrupt; an interactive attention signal.@item SIGSEGVAn attempt to access a memory location that is not available.@item SIGTERMA request that your program end execution.@end tableTwo functions are available for dealing with asynchronoussignals---one to allow your program to send signals to itself (this iscalled @dfn{raising} a signal), and one to specify subroutines (called@dfn{handlers} to handle particular signals that you anticipate mayoccur---whether raised by your own program or the operating environment.To support these functions, @file{signal.h} defines three macros:@table @code@item SIG_DFLUsed with the @code{signal} function in place of a pointer to ahandler subroutine, to select the operating environment's defaulthandling of a signal.@item SIG_IGNUsed with the @code{signal} function in place of a pointer to ahandler, to ignore a particular signal.@item SIG_ERRReturned by the @code{signal} function in place of a pointer to ahandler, to indicate that your request to set up a handler could notbe honored for some reason.@end table@file{signal.h} also defines an integral type, @code{sig_atomic_t}.This type is not used in any function declarations; it exists only toallow your signal handlers to declare a static storage location wherethey may store a signal value.  (Static storage is not otherwisereliable from signal handlers.)@menu* raise::   Send a signal* signal::  Specify handler subroutine for a signal@end menu@page@include signal/raise.def@page@include signal/signal.def

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -