This function is a GNU extension,declared in the header file`string.h'.
voidpsignal(intsignum,const char *message)
-
This function prints a message describing the signalsignumto the standard error output stream
stderr ; see section.
If you callpsignal with amessagethat is either a null pointer or an empty string,psignal just prints the message corresponding tosignum,adding a trailing newline.
If you supply a non-nullmessageargument,thenpsignal prefixes its output with this string. It adds a colon and a space character to separate themessagefrom the string corresponding tosignum.
This function is a BSD feature,declared in the header file`signal.h'.
sys_siglistwhich contains the messages for the various signal codes. This array exists on BSD systems,unlikestrsignal .
signalfunction. You can specify a built-in action (such as to ignore the signal),or you canestablish a handler.
sigactionfacility. This section describes both facilities and gives suggestions on which to use when.
signalfunction provides a simple interface for establishing an action for a particular signal. The function and associated macros are declared in the header file`signal.h'.
sighandler_t
-
This is the type of signal handler functions. Signal handlers take one integer argument specifying the signal number,and have return type
void . So,you should define handler functions like this:
void handler (int signum ) { ... }
(编辑:ASP站长)
【免责声明】本站内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。
|