HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
s
sigaction(2) sigaction(2)
The behaviour of a process is undefined after it returns normally from a signal- catching function
for a SIGBUS, SIGFPE, SIGILL,orSIGSEGV signal that was not generated by kill() or
raise().
The system will not allow a process to catch the signals SIGKILL and SIGSTOP.
If a process establishes a signal-catching function for the SIGCHLD signal while it has a ter-
minated child process for which it has not waited, it is unspecified whether a SIGCHILD signal is
generated to indicate that child process.
When signal-catching functions are invoked asynchronously with process execution, the behaviour
of some of the functions defined by this document is unspecified if they are called from a
signal-catching function.
The following table defines a set of functions that are either reentrant or not interruptible by sig-
nals. Therefore applicationsmay invoke them, without restriction, from signal-catching functions:
access() fstat() read() sysconf()
alarm() getegid() rename() tcdrain()
cfgetispeed() geteuid() rmdir() tcflow()
cfgetospeed() getgid() setgid() tcflush()
cfsetispeed() getgroups() setpgid() tcgetattr()
cfsetospeed() getpgrp() setsid() tcgetpgrp()
chdir() getpid() setuid() tcsendbreak()
chmod() getppid() sigaction() tcsetattr()
chown() getuid() sigaddset() tcsetpgrp()
close() kill() sigdelset() time()
creat() link() sigemptyset() times()
dup2() lseek() sigfillset() umask()
dup() mkdir() sigismember() uname()
execle() mkfifo() signal() unlink()
execve() open() sigpending() utime()
_exit() pathconf() sigprocmask() wait()
sigqueue()
fcntl() pause() sigsuspend() waitpid()
fork() pipe() sleep() write()
fpathconf() raise() stat()
All functions not in the above table are considered to be unsafe with respect to signals. In the pres-
ence of signals, all functions defined by this document will behave as defined when called from or
interrupted by a signal-catching function, with a single exception: when a signal interrupts an
unsafe function and the signal-catching function calls an unsafe function, the behaviour is
undefined.
Signal Effects on Other Functions
Signals affect the behaviour of certain functions defined by this document if delivered to a process while it
is executing such a function. If the action of the signal is to terminate the process, the process will be ter-
minated and the function will not return. If the action of the signal is to stop the process, the process will
stop until continued or terminated. Generation of a SIGCONT signal for the process causes the process to
be continued, and the original function will continue at the point the process was stopped. If the action of
the signal is to invoke a signal-catching function, the signal-catching function will be invoked; in this case
the original function is said to be interrupted by the signal. If the signal-catching function executes a
return statement, the behaviour of the interrupted function will be as described individually for that func-
tion. Signals that are ignored will not affect the behaviour of any function; signals that are blocked will not
affect the behaviour of any function until they are unblocked and then delivered.
RETURN VALUE
Upon successful completion, sigaction() returns 0. Otherwise 1 is returned, errno is set to indicate
the error and no new signal-catching function will be installed.
ERRORS
The sigaction() function will fail if:
[EINVAL] The sig argument is not a valid signal number or an attempt is made to
catch a signal that cannot be caught or ignore a signal that cannot be
HP-UX Release 11i: December 2000 5 Section 2337
___
___