1<assertions> 2 <assertion id="1" tag="ref:XSH6:41442:41443 pt:CX"> 3If the argument "act" is not a null pointer, it points to a structure 4specifying the action to be associated with the specified signal. 5 </assertion> 6 <assertion id="2" tag="ref:XSH6:41443:41444 pt:CX"> 7If the argument "oact" is not a null pointer, the action previously 8associated with the signal is stored in the location pointed to by 9the argument "oact". 10 </assertion> 11 <assertion id="3" tag="ref:XSH6:41444:41445 pt:CX"> 12If the argument "act" is a null pointer, signal handling is unchanged. 13 </assertion> 14 <assertion id="4" tag="ref:XSH6:41446:41447 pt:CX"> 15The SIGKILL and SIGSTOP signals shall not be added to the signal mask 16using sigaction(), but will not result in sigaction reporting a failure. 17 </assertion> 18 <assertion id="5" tag="ref:XSH6:41449:41450 pt:CX"> 19If the SA_SIGINFO flag is cleared in the sa_flags field of the sigaction 20structure, the sa_handler field indentifies the action to be associated 21with the specified signal. 22 </assertion> 23 <assertion id="6" tag="ref:XSH6:41450:41453 pt:XSI,RTS"> 24If the SA_SIGINFO flag is set in the sa_flags field, and the implementation 25supports the Realtime Signals Extension option or the XSI Extension option, 26the sa_sigaction field specifies a signal catching function. 27 </assertion> 28 <assertion id="7" tag="ref:XSH6:41453:41455 pt:CX"> 29If the SA_SIGINFO bit is cleared and the sa_handler field specifies a 30signal catching function, or if the SA_SIGINFO bit is set, the sa_mask 31field indentifies a set of signals that shall be added to the signal mask 32of the thread before the signal-catching function is invoked. 33 </assertion> 34 <assertion id="8" tag="ref:XSH6:41455:41458 pt:CX"> 35If the sa_handler field specifies a signal-catching function, the sa_mask 36field indentifies a set of signals that shall be added to the process' 37signal mask before the signal-catching function is invoked. 38 </assertion> 39 <assertion id="9" tag="ref:XSH6:41461:41462 pt:CX"> 40If the SA_NOCLDSTOP bit is set in the sa_flags field when calling sigaction 41on SIGCHLD, then the SIGCHLD signal will not be generated when children stop 42or stopped children continue. 43 </assertion> 44 <assertion id="10" tag="ref:XSH6:41463:41466 pt:CX"> 45If sig is SIGCHLD and the SA_NOCLDSTOP flag is not set in sa_flags, and the 46implementation supports the SIGCHLD signal, then a SIGCHLD signal shall be 47generated for the calling process whenever any of its child processes 48stop. 49 </assertion> 50 <assertion id="11" tag="ref:XSH6:41463:41465 pt:XSI"> 51Not setting the SA_NOCLDSTOP flag on the SIGCHLD signal will result in a 52SIGCHLD signal being generated for the parent process whenever any of it's 53stopped children are continued. 54 </assertion> 55 <assertion id="12" tag="ref:XSH6:41470:41471 pt:XSI"> 56If the SA_ONSTACK flag is set in sa_flags, and an alternate signal stack has 57been declared with sigaltstack(), the signal shall be delivered to the calling 58process on the stack. Otherwise, the signal shall be delivered on the current 59stack. 60 </assertion> 61 <assertion id="13" tag="ref:XSH6:41471:41472 pt:XSI"> 62If the SA_ONSTACK flag is not set in sa_flags, the signal shall be delivered 63on the current stack. 64 </assertion> 65 <assertion id="14" tag="ref:XSH6TC2:42543:42550 pt:XSI"> 66If the SA_RESETHAND flag is set in sa_flags, then the disposition of the signal 67shall be reset to SIG_DFL and the SA_SIGINFO flag shall be cleared on entry 68to the signal handler. The routine behaves as if SA_NODEFER was also set. 69 </assertion> 70 <assertion id="15" tag="ref:XSH6:41477:41480 pt:XSI"> 71If the SA_RESETHAND flag is not set in sa_flags, the disposition of the signal 72shall not be modified on entry to the signal handler. 73 </assertion> 74 <assertion id="16" tag="ref:XSH6:41481:41486 pt:XSI"> 75Interruptable functions (functions specified to fail with errno set to [EINTR] 76when interrupted by a signal) shall restart and shall not fail with [EINTR] 77if the SA_RESTART flag is set in sa_flags. 78 </assertion> 79 <assertion id="17" tag="ref:XSH6:41481:41486 pt:CX"> 80If the SA_RESTART flag is not set in sa_flags, then interruptable functions 81will fail with with errno set to [EINTR]. 82 </assertion> 83 <assertion id="18" tag="ref:XSH6:41494:41495 pt:XSI"> 84If the SA_SIGINFO flag is not set for a signal and the signal is caught then 85the signal-catching function shall be entered as "void func(int signo);". 86 </assertion> 87 <assertion id="19" tag="ref:XSH6:41487:41488 pt:CX"> 88If the SA_SIGINFO flag is set for a signal and the signal is caught then 89the signal -catching function shall be entered as 90"void func(int signo, siginfo_t *info, void *context);" 91 </assertion> 92 <assertion id="20" tag="ref:XSH6:41515:41522 pt:XSI"> 93If the SA_NOCLDWAIT flag is set and sig equals SIGCHLD, then child processes 94of the calling process shall not be trasformed into zombie processes when 95they terminate. 96 </assertion> 97 <assertion id="21" tag="ref:XSH6:41515:41522 pt:XSI"> 98If a process has set the SA_NOCLDWAIT flag on SIGCHLD and subseqeunetly waits 99for a its children, and the process has not unwaited-for children that were 100trasformed into zombie processes, it shall block until all of its children 101terminate, and wait(), waitid(), and waitpid() shall fail and set errno to 102[ECHILD]. 103 </assertion> 104 <assertion id="22" tag="ref:XSH6:41523:41526 pt:XSI"> 105If the SA_NODEFER flag is set for a signal and the signal is caught, the signal 106shall not be added to the process' signal mask on entry to the signal handler 107unless it is included in sa_mask. 108 </assertion> 109 <assertion id="23" tag="ref:XSH6:41523:41526 pt:XSI"> 110If the SA_NODEFER flag is not set for a signal and the signal is caught, the 111signal shall be added to the process' signal mask on entry to the signal 112handler. 113 </assertion> 114 <assertion id="24" tag="ref:XSH6:41527:41529 pt:CX"> 115When a signal-catching function installed by sigaction() is entered, a new 116signal mask is calculated and installed for the duration of the signal-catching 117function (or until a call to either sigprocmask() or sigsuspend() is made.) 118 </assertion> 119 <assertion id="25" tag="ref:XSH6:41527:41532 pt:CX"> 120The new signal mask installed on entry to a signal-catching function installed 121by sigaction shall be calculated as the union of the current signal mask 122and the value of sa_mask for the signal being delivered (unless SA_NODEFER 123or SA_RESETHAND is set) and then including the signal being delivered. 124 </assertion> 125 <assertion id="26" tag="ref:XSH6:41527:41532 pt:CX"> 126If and when the user's signal handler returns normally, the original signal 127mask is restored. 128 </assertion> 129 <assertion id="27" tag="ref:XSH6:41541:41541 pt:CX"> 130If sigaction fails, no new signal handler is installed. 131 </assertion> 132 <assertion id="28" tag="ref:XSH6TC2:42606:42610 pt:CX"> 133If the signal action was set with the signal() function, getting it into oact 134then reinstalling it with act must be valid. 135 </assertion> 136 <assertion id="29" tag="ref:XSH6TC2:42616:42622 pt:RTS"> 137If SA_SIGINFO is set and realtime signals extension is supported, queueable 138signals generated by sigqueue or some other functions are delivered in FIFO 139order. 140 </assertion> 141 <assertion id="30" tag="ref:XSH6TC2:42630:42631 pt:CX"> 142sigaction returns -1 and errno is set to EINVAL if signal number is invalid 143or an attempt to do an operation which is not allowed is made. 144 </assertion> 145</assertions> 146