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 ) { ... }
(编辑:威海站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|