| The return value is0on success and-1on failure. Ifsigaltstackfails,it setserrnoto one of these values: 
EINVALYou tried to disable a stack that was in fact currently in use.ENOMEMThe size of the alternate stack was too small. It must be greater thanMINSIGSTKSZ. sigstackinterface. You should usesigaltstackinstead on systems that have it. 
struct sigstack
This structure describes a signal stack. It contains the following members:
void *ss_spThis is the stack pointer. If the stack grows downwards on your machine,this should point to the top of the area you allocated. If the stack grows upwards,it should point to the bottom.int ss_onstackThis field is true if the process is currently using this stack. 
intsigstack(const struct sigstack *stack,struct sigstack *oldstack)
Thesigstackfunction specifies an alternate stack for use during signal handling. When a signal is received by the process and its action indicates that the signal stack is used,then this is installed as the new stack for use by signal handlers.The return value is0on success and-1on failure. 
 
 BSD Unix represents signal masks as anintbit mask,rather than as asigset_tobject.The BSD facilities use a different default for whether an interrupted primitive should fail or resume. The POSIX facilities make system calls fail unless you specify that they should resume. With the BSD facility,the default is to make system calls resume unless you say they should fail. See section. `signal.h'. 
struct sigvec
This data type is the BSD equivalent ofstruct sigaction(see section); it is used to specify signal actions to thesigvecfunction. It contains the following members:
sighandler_t sv_handlerThis is the handler function.int sv_maskThis is the mask of additional signals to be blocked while the handler function is being called.int sv_flagsThis is a bit mask used to specify various flags which affect the behavior of the signal. You can also refer to this field assv_onstack.sv_flagsfield of asigvecstructure. This field is a bit mask value,so you bitwise-OR the flags of interest to you together. 
intSV_ONSTACK
If this bit is set in thesv_flagsfield of asigvecstructure,it means to use the signal stack when delivering the signal. 
intSV_INTERRUPT
If this bit is set in thesv_flagsfield of asigvecstructure,it means that system calls interrupted by this kind of signal should not be restarted if the handler returns; instead,the system calls should return with aEINTRerror status. See section. 
intSV_RESETHAND
If this bit is set in thesv_flagsfield of asigvecstructure,it means to reset the action for the signal back toSIG_DFLwhen the signal is received. 
intsigvec(intsignum,const struct sigvec *action,struct sigvec *old-action)
This function is the equivalent ofsigaction(see section); it installs the actionactionfor the signalsignum,returning information about the previous action in effect for that signal inold-action. 
intsiginterrupt(intsignum,intfailflag)
This function specifies which approach to use when certain primitives are interrupted by handling signalsignum. Iffailflagis false,signalsignumrestarts primitives. Iffailflagis true,handlingsignumcauses these primitives to fail with error codeEINTR. See section. 
intsigmask(intsignum)
This macro returns a signal mask that has the bit for signalsignumset. You can bitwise-OR the results of several calls tosigmasktogether to specify more than one signal. For example,(sigmask (SIGTSTP) | sigmask (SIGSTOP)
 | sigmask (SIGTTIN) | sigmask (SIGTTOU))
 (编辑:南平站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |