加入收藏 | 设为首页 | 会员中心 | 我要投稿 威海站长网 (https://www.0631zz.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Signal Handling--ref

发布时间:2021-01-25 08:01:09 所属栏目:Linux 来源:网络整理
导读:signal is a software interrupt delivered to a process. The operating system uses signals to report exceptional situations to an executing program. Some signals report errors such as references to invalid memory addresses; others report asy

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 streamstderr; see section.

If you callpsignalwith amessagethat is either a null pointer or an empty string,psignaljust prints the message corresponding tosignum,adding a trailing newline.

If you supply a non-nullmessageargument,thenpsignalprefixes 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 typevoid. So,you should define handler functions like this:
void handler (int signum) { ... }

(编辑:威海站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读