diff options
| author | Michael Kerrisk <mtk.manpages@gmail.com> | 2016-11-09 13:40:16 +0100 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2016-12-12 12:53:05 +0100 |
| commit | d1329af1f3fd446c5616d2d9a1ef75cc64caaec8 (patch) | |
| tree | 0d48cb7bf4633bd0fe5b018fb29f8b7a550c11cd /man7/signal.7 | |
| parent | 6eb174c60d2df592c51c34d80af96f4ef51d967e (diff) | |
| download | man-pages-d1329af1f3fd446c5616d2d9a1ef75cc64caaec8.tar.gz | |
signal-safety.7, signal.7: Migrate discussion of async-signal-safe functions to new page
Also:
* add more detail on changes across standards
* provide proper section cross references in function references
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man7/signal.7')
| -rw-r--r-- | man7/signal.7 | 188 |
1 files changed, 3 insertions, 185 deletions
diff --git a/man7/signal.7 b/man7/signal.7 index e572f2785a..d72229bdc9 100644 --- a/man7/signal.7 +++ b/man7/signal.7 @@ -466,191 +466,6 @@ Linux 2.0 and earlier Linux 2.2 and later \fBsigtimedwait\fP(2) \fBrt_sigtimedwait\fP(2) .TE .\" -.SS Async-signal-safe functions -.PP -A signal handler function must be very careful, -since processing elsewhere may be interrupted -at some arbitrary point in the execution of the program. -POSIX has the concept of "safe function". -If a signal interrupts the execution of an unsafe function, and -.I handler -either calls an unsafe function or -.I handler -terminates via a call to -.BR longjmp () -or -.BR siglongjmp () -and the program subsequently calls an unsafe function, -then the behavior of the program is undefined. - -POSIX.1-2004 (also known as POSIX.1-2001 Technical Corrigendum 2) -requires an implementation to guarantee that the following -functions can be safely called inside a signal handler: - -.in +4 -.nf -_Exit() -_exit() -abort() -accept() -access() -aio_error() -aio_return() -aio_suspend() -alarm() -bind() -cfgetispeed() -cfgetospeed() -cfsetispeed() -cfsetospeed() -chdir() -chmod() -chown() -clock_gettime() -close() -connect() -creat() -dup() -dup2() -execle() -execve() -fchmod() -fchown() -fcntl() -fdatasync() -fork() -fpathconf() -fstat() -fsync() -ftruncate() -getegid() -geteuid() -getgid() -getgroups() -getpeername() -getpgrp() -getpid() -getppid() -getsockname() -getsockopt() -getuid() -kill() -link() -listen() -lseek() -lstat() -mkdir() -mkfifo() -open() -pathconf() -pause() -pipe() -poll() -posix_trace_event() -pselect() -raise() -read() -readlink() -recv() -recvfrom() -recvmsg() -rename() -rmdir() -select() -sem_post() -send() -sendmsg() -sendto() -setgid() -setpgid() -setsid() -setsockopt() -setuid() -shutdown() -sigaction() -sigaddset() -sigdelset() -sigemptyset() -sigfillset() -sigismember() -signal() -sigpause() -sigpending() -sigprocmask() -sigqueue() -sigset() -sigsuspend() -sleep() -sockatmark() -socket() -socketpair() -stat() -symlink() -sysconf() -tcdrain() -tcflow() -tcflush() -tcgetattr() -tcgetpgrp() -tcsendbreak() -tcsetattr() -tcsetpgrp() -time() -timer_getoverrun() -timer_gettime() -timer_settime() -times() -umask() -uname() -unlink() -utime() -wait() -waitpid() -write() -.fi -.in -.PP -POSIX.1-2008 removes fpathconf(), pathconf(), and sysconf() -from the above list, and adds the following functions: -.PP -.in +4n -.nf -execl() -execv() -faccessat() -fchmodat() -fchownat() -fexecve() -fstatat() -futimens() -linkat() -mkdirat() -mkfifoat() -mknod() -mknodat() -openat() -readlinkat() -renameat() -symlinkat() -unlinkat() -utimensat() -utimes() -.fi -.in -.PP -POSIX.1-2008 Technical Corrigendum 1 (2013) -adds the following functions: -.PP -.in +4n -.nf -fchdir() -pthread_kill() -pthread_self() -pthread_sigmask() -.fi -.in -.\" FIXME POSIX.1-2008 TC 2 looks set to add many more async-signal-safe -.\" functions. Document these. .SS Interruption of system calls and library functions by signal handlers If a signal handler is invoked while a system call or library function call is blocked, then either: @@ -918,6 +733,9 @@ POSIX.1, except as noted. .\" the build process of some software still thinks that .\" signal 29 is .\" .BR SIGLOST . +.SH NOTES +For a discussion of async-signal-safe functions, see +.BR signal-safety (7). .SH SEE ALSO .BR kill (1), .BR getrlimit (2), |
