# phpman > info > SIGNAL-SAFETY

[SIGNAL-SAFETY(7)](https://www.chedong.com/phpMan.php/man/SIGNAL-SAFETY/7/markdown)           Linux Programmer's Manual          [SIGNAL-SAFETY(7)](https://www.chedong.com/phpMan.php/man/SIGNAL-SAFETY/7/markdown)

NAME
       signal-safety - async-signal-safe functions

DESCRIPTION
       An  async-signal-safe  function  is  one that can be safely called from
       within a signal handler.  Many functions are not async-signal-safe.  In
       particular,  nonreentrant functions are generally unsafe to call from a
       signal handler.

       The kinds of issues that render a function unsafe can be quickly under-
       stood  when  one considers the implementation of the stdio library, all
       of whose functions are not async-signal-safe.

       When performing buffered I/O on a file, the stdio functions must  main-
       tain  a statically allocated data buffer along with associated counters
       and indexes (or pointers) that record the amount of data and  the  cur-
       rent  position  in the buffer.  Suppose that the main program is in the
       middle of a call to a stdio function such as [printf(3)](https://www.chedong.com/phpMan.php/man/printf/3/markdown) where the buffer
       and  associated variables have been partially updated.  If, at that mo-
       ment, the program is interrupted by a signal handler  that  also  calls
       [printf(3)](https://www.chedong.com/phpMan.php/man/printf/3/markdown),  then the second call to [printf(3)](https://www.chedong.com/phpMan.php/man/printf/3/markdown) will operate on inconsis-
       tent data, with unpredictable results.

       To avoid  problems  with  unsafe  functions,  there  are  two  possible
       choices:

       1. Ensure  that  (a)  the  signal  handler calls only async-signal-safe
          functions, and (b) the signal handler itself is reentrant  with  re-
          spect to global variables in the main program.

       2. Block  signal  delivery  in  the main program when calling functions
          that are unsafe or operating on global data that is also accessed by
          the signal handler.

       Generally,  the  second choice is difficult in programs of any complex-
       ity, so the first choice is taken.

       POSIX.1 specifies a set of functions that an implementation  must  make
       async-signal-safe.  (An implementation may provide safe implementations
       of additional functions, but this is not required by the  standard  and
       other implementations may not provide the same guarantees.)

       In  general, a function is async-signal-safe either because it is reen-
       trant or because it is atomic with respect to signals (i.e., its execu-
       tion can't be interrupted by a signal handler).

       The  set  of  functions  required to be async-signal-safe by POSIX.1 is
       shown in the following table.  The functions not otherwise  noted  were
       required  to  be  async-signal-safe  in POSIX.1-2001; the table details
       changes in the subsequent standards.

       Function               Notes
       [abort(3)](https://www.chedong.com/phpMan.php/man/abort/3/markdown)               Added in POSIX.1-2001 TC1
       [accept(2)](https://www.chedong.com/phpMan.php/man/accept/2/markdown)
       [access(2)](https://www.chedong.com/phpMan.php/man/access/2/markdown)
       [aio_error(3)](https://www.chedong.com/phpMan.php/man/aioerror/3/markdown)
       [aio_return(3)](https://www.chedong.com/phpMan.php/man/aioreturn/3/markdown)
       [aio_suspend(3)](https://www.chedong.com/phpMan.php/man/aiosuspend/3/markdown)         See notes below
       [alarm(2)](https://www.chedong.com/phpMan.php/man/alarm/2/markdown)
       [bind(2)](https://www.chedong.com/phpMan.php/man/bind/2/markdown)
       [cfgetispeed(3)](https://www.chedong.com/phpMan.php/man/cfgetispeed/3/markdown)

       [cfgetospeed(3)](https://www.chedong.com/phpMan.php/man/cfgetospeed/3/markdown)
       [cfsetispeed(3)](https://www.chedong.com/phpMan.php/man/cfsetispeed/3/markdown)
       [cfsetospeed(3)](https://www.chedong.com/phpMan.php/man/cfsetospeed/3/markdown)
       [chdir(2)](https://www.chedong.com/phpMan.php/man/chdir/2/markdown)
       [chmod(2)](https://www.chedong.com/phpMan.php/man/chmod/2/markdown)
       [chown(2)](https://www.chedong.com/phpMan.php/man/chown/2/markdown)
       [clock_gettime(2)](https://www.chedong.com/phpMan.php/man/clockgettime/2/markdown)
       [close(2)](https://www.chedong.com/phpMan.php/man/close/2/markdown)
       [connect(2)](https://www.chedong.com/phpMan.php/man/connect/2/markdown)
       [creat(2)](https://www.chedong.com/phpMan.php/man/creat/2/markdown)
       [dup(2)](https://www.chedong.com/phpMan.php/man/dup/2/markdown)
       [dup2(2)](https://www.chedong.com/phpMan.php/man/dup2/2/markdown)
       [execl(3)](https://www.chedong.com/phpMan.php/man/execl/3/markdown)               Added in POSIX.1-2008; see notes below
       [execle(3)](https://www.chedong.com/phpMan.php/man/execle/3/markdown)              See notes below
       [execv(3)](https://www.chedong.com/phpMan.php/man/execv/3/markdown)               Added in POSIX.1-2008
       [execve(2)](https://www.chedong.com/phpMan.php/man/execve/2/markdown)
       [_exit(2)](https://www.chedong.com/phpMan.php/man/exit/2/markdown)
       [_Exit(2)](https://www.chedong.com/phpMan.php/man/Exit/2/markdown)
       [faccessat(2)](https://www.chedong.com/phpMan.php/man/faccessat/2/markdown)           Added in POSIX.1-2008
       [fchdir(2)](https://www.chedong.com/phpMan.php/man/fchdir/2/markdown)              Added in POSIX.1-2008 TC1
       [fchmod(2)](https://www.chedong.com/phpMan.php/man/fchmod/2/markdown)
       [fchmodat(2)](https://www.chedong.com/phpMan.php/man/fchmodat/2/markdown)            Added in POSIX.1-2008
       [fchown(2)](https://www.chedong.com/phpMan.php/man/fchown/2/markdown)
       [fchownat(2)](https://www.chedong.com/phpMan.php/man/fchownat/2/markdown)            Added in POSIX.1-2008
       [fcntl(2)](https://www.chedong.com/phpMan.php/man/fcntl/2/markdown)
       [fdatasync(2)](https://www.chedong.com/phpMan.php/man/fdatasync/2/markdown)
       [fexecve(3)](https://www.chedong.com/phpMan.php/man/fexecve/3/markdown)             Added in POSIX.1-2008
       [ffs(3)](https://www.chedong.com/phpMan.php/man/ffs/3/markdown)                 Added in POSIX.1-2008 TC2
       [fork(2)](https://www.chedong.com/phpMan.php/man/fork/2/markdown)                See notes below
       [fstat(2)](https://www.chedong.com/phpMan.php/man/fstat/2/markdown)
       [fstatat(2)](https://www.chedong.com/phpMan.php/man/fstatat/2/markdown)             Added in POSIX.1-2008
       [fsync(2)](https://www.chedong.com/phpMan.php/man/fsync/2/markdown)
       [ftruncate(2)](https://www.chedong.com/phpMan.php/man/ftruncate/2/markdown)
       [futimens(3)](https://www.chedong.com/phpMan.php/man/futimens/3/markdown)            Added in POSIX.1-2008
       [getegid(2)](https://www.chedong.com/phpMan.php/man/getegid/2/markdown)
       [geteuid(2)](https://www.chedong.com/phpMan.php/man/geteuid/2/markdown)
       [getgid(2)](https://www.chedong.com/phpMan.php/man/getgid/2/markdown)
       [getgroups(2)](https://www.chedong.com/phpMan.php/man/getgroups/2/markdown)
       [getpeername(2)](https://www.chedong.com/phpMan.php/man/getpeername/2/markdown)
       [getpgrp(2)](https://www.chedong.com/phpMan.php/man/getpgrp/2/markdown)
       [getpid(2)](https://www.chedong.com/phpMan.php/man/getpid/2/markdown)
       [getppid(2)](https://www.chedong.com/phpMan.php/man/getppid/2/markdown)
       [getsockname(2)](https://www.chedong.com/phpMan.php/man/getsockname/2/markdown)
       [getsockopt(2)](https://www.chedong.com/phpMan.php/man/getsockopt/2/markdown)
       [getuid(2)](https://www.chedong.com/phpMan.php/man/getuid/2/markdown)
       [htonl(3)](https://www.chedong.com/phpMan.php/man/htonl/3/markdown)               Added in POSIX.1-2008 TC2
       [htons(3)](https://www.chedong.com/phpMan.php/man/htons/3/markdown)               Added in POSIX.1-2008 TC2
       [kill(2)](https://www.chedong.com/phpMan.php/man/kill/2/markdown)
       [link(2)](https://www.chedong.com/phpMan.php/man/link/2/markdown)
       [linkat(2)](https://www.chedong.com/phpMan.php/man/linkat/2/markdown)              Added in POSIX.1-2008
       [listen(2)](https://www.chedong.com/phpMan.php/man/listen/2/markdown)
       [longjmp(3)](https://www.chedong.com/phpMan.php/man/longjmp/3/markdown)             Added in POSIX.1-2008 TC2; see notes below
       [lseek(2)](https://www.chedong.com/phpMan.php/man/lseek/2/markdown)
       [lstat(2)](https://www.chedong.com/phpMan.php/man/lstat/2/markdown)
       [memccpy(3)](https://www.chedong.com/phpMan.php/man/memccpy/3/markdown)             Added in POSIX.1-2008 TC2
       [memchr(3)](https://www.chedong.com/phpMan.php/man/memchr/3/markdown)              Added in POSIX.1-2008 TC2
       [memcmp(3)](https://www.chedong.com/phpMan.php/man/memcmp/3/markdown)              Added in POSIX.1-2008 TC2
       [memcpy(3)](https://www.chedong.com/phpMan.php/man/memcpy/3/markdown)              Added in POSIX.1-2008 TC2
       [memmove(3)](https://www.chedong.com/phpMan.php/man/memmove/3/markdown)             Added in POSIX.1-2008 TC2
       [memset(3)](https://www.chedong.com/phpMan.php/man/memset/3/markdown)              Added in POSIX.1-2008 TC2
       [mkdir(2)](https://www.chedong.com/phpMan.php/man/mkdir/2/markdown)
       [mkdirat(2)](https://www.chedong.com/phpMan.php/man/mkdirat/2/markdown)             Added in POSIX.1-2008
       [mkfifo(3)](https://www.chedong.com/phpMan.php/man/mkfifo/3/markdown)
       [mkfifoat(3)](https://www.chedong.com/phpMan.php/man/mkfifoat/3/markdown)            Added in POSIX.1-2008
       [mknod(2)](https://www.chedong.com/phpMan.php/man/mknod/2/markdown)               Added in POSIX.1-2008

       [mknodat(2)](https://www.chedong.com/phpMan.php/man/mknodat/2/markdown)             Added in POSIX.1-2008
       [ntohl(3)](https://www.chedong.com/phpMan.php/man/ntohl/3/markdown)               Added in POSIX.1-2008 TC2
       [ntohs(3)](https://www.chedong.com/phpMan.php/man/ntohs/3/markdown)               Added in POSIX.1-2008 TC2
       [open(2)](https://www.chedong.com/phpMan.php/man/open/2/markdown)
       [openat(2)](https://www.chedong.com/phpMan.php/man/openat/2/markdown)              Added in POSIX.1-2008
       [pause(2)](https://www.chedong.com/phpMan.php/man/pause/2/markdown)
       [pipe(2)](https://www.chedong.com/phpMan.php/man/pipe/2/markdown)
       [poll(2)](https://www.chedong.com/phpMan.php/man/poll/2/markdown)
       [posix_trace_event(3)](https://www.chedong.com/phpMan.php/man/posixtraceevent/3/markdown)
       [pselect(2)](https://www.chedong.com/phpMan.php/man/pselect/2/markdown)
       [pthread_kill(3)](https://www.chedong.com/phpMan.php/man/pthreadkill/3/markdown)        Added in POSIX.1-2008 TC1
       [pthread_self(3)](https://www.chedong.com/phpMan.php/man/pthreadself/3/markdown)        Added in POSIX.1-2008 TC1
       [pthread_sigmask(3)](https://www.chedong.com/phpMan.php/man/pthreadsigmask/3/markdown)     Added in POSIX.1-2008 TC1
       [raise(3)](https://www.chedong.com/phpMan.php/man/raise/3/markdown)
       [read(2)](https://www.chedong.com/phpMan.php/man/read/2/markdown)
       [readlink(2)](https://www.chedong.com/phpMan.php/man/readlink/2/markdown)
       [readlinkat(2)](https://www.chedong.com/phpMan.php/man/readlinkat/2/markdown)          Added in POSIX.1-2008
       [recv(2)](https://www.chedong.com/phpMan.php/man/recv/2/markdown)
       [recvfrom(2)](https://www.chedong.com/phpMan.php/man/recvfrom/2/markdown)
       [recvmsg(2)](https://www.chedong.com/phpMan.php/man/recvmsg/2/markdown)
       [rename(2)](https://www.chedong.com/phpMan.php/man/rename/2/markdown)
       [renameat(2)](https://www.chedong.com/phpMan.php/man/renameat/2/markdown)            Added in POSIX.1-2008
       [rmdir(2)](https://www.chedong.com/phpMan.php/man/rmdir/2/markdown)
       [select(2)](https://www.chedong.com/phpMan.php/man/select/2/markdown)
       [sem_post(3)](https://www.chedong.com/phpMan.php/man/sempost/3/markdown)
       [send(2)](https://www.chedong.com/phpMan.php/man/send/2/markdown)
       [sendmsg(2)](https://www.chedong.com/phpMan.php/man/sendmsg/2/markdown)
       [sendto(2)](https://www.chedong.com/phpMan.php/man/sendto/2/markdown)
       [setgid(2)](https://www.chedong.com/phpMan.php/man/setgid/2/markdown)
       [setpgid(2)](https://www.chedong.com/phpMan.php/man/setpgid/2/markdown)
       [setsid(2)](https://www.chedong.com/phpMan.php/man/setsid/2/markdown)
       [setsockopt(2)](https://www.chedong.com/phpMan.php/man/setsockopt/2/markdown)
       [setuid(2)](https://www.chedong.com/phpMan.php/man/setuid/2/markdown)
       [shutdown(2)](https://www.chedong.com/phpMan.php/man/shutdown/2/markdown)
       [sigaction(2)](https://www.chedong.com/phpMan.php/man/sigaction/2/markdown)
       [sigaddset(3)](https://www.chedong.com/phpMan.php/man/sigaddset/3/markdown)
       [sigdelset(3)](https://www.chedong.com/phpMan.php/man/sigdelset/3/markdown)
       [sigemptyset(3)](https://www.chedong.com/phpMan.php/man/sigemptyset/3/markdown)
       [sigfillset(3)](https://www.chedong.com/phpMan.php/man/sigfillset/3/markdown)
       [sigismember(3)](https://www.chedong.com/phpMan.php/man/sigismember/3/markdown)
       [siglongjmp(3)](https://www.chedong.com/phpMan.php/man/siglongjmp/3/markdown)          Added in POSIX.1-2008 TC2; see notes below
       [signal(2)](https://www.chedong.com/phpMan.php/man/signal/2/markdown)
       [sigpause(3)](https://www.chedong.com/phpMan.php/man/sigpause/3/markdown)
       [sigpending(2)](https://www.chedong.com/phpMan.php/man/sigpending/2/markdown)
       [sigprocmask(2)](https://www.chedong.com/phpMan.php/man/sigprocmask/2/markdown)
       [sigqueue(2)](https://www.chedong.com/phpMan.php/man/sigqueue/2/markdown)
       [sigset(3)](https://www.chedong.com/phpMan.php/man/sigset/3/markdown)
       [sigsuspend(2)](https://www.chedong.com/phpMan.php/man/sigsuspend/2/markdown)
       [sleep(3)](https://www.chedong.com/phpMan.php/man/sleep/3/markdown)
       [sockatmark(3)](https://www.chedong.com/phpMan.php/man/sockatmark/3/markdown)          Added in POSIX.1-2001 TC2
       [socket(2)](https://www.chedong.com/phpMan.php/man/socket/2/markdown)
       [socketpair(2)](https://www.chedong.com/phpMan.php/man/socketpair/2/markdown)
       [stat(2)](https://www.chedong.com/phpMan.php/man/stat/2/markdown)
       [stpcpy(3)](https://www.chedong.com/phpMan.php/man/stpcpy/3/markdown)              Added in POSIX.1-2008 TC2
       [stpncpy(3)](https://www.chedong.com/phpMan.php/man/stpncpy/3/markdown)             Added in POSIX.1-2008 TC2
       [strcat(3)](https://www.chedong.com/phpMan.php/man/strcat/3/markdown)              Added in POSIX.1-2008 TC2
       [strchr(3)](https://www.chedong.com/phpMan.php/man/strchr/3/markdown)              Added in POSIX.1-2008 TC2
       [strcmp(3)](https://www.chedong.com/phpMan.php/man/strcmp/3/markdown)              Added in POSIX.1-2008 TC2
       [strcpy(3)](https://www.chedong.com/phpMan.php/man/strcpy/3/markdown)              Added in POSIX.1-2008 TC2
       [strcspn(3)](https://www.chedong.com/phpMan.php/man/strcspn/3/markdown)             Added in POSIX.1-2008 TC2
       [strlen(3)](https://www.chedong.com/phpMan.php/man/strlen/3/markdown)              Added in POSIX.1-2008 TC2
       [strncat(3)](https://www.chedong.com/phpMan.php/man/strncat/3/markdown)             Added in POSIX.1-2008 TC2
       [strncmp(3)](https://www.chedong.com/phpMan.php/man/strncmp/3/markdown)             Added in POSIX.1-2008 TC2
       [strncpy(3)](https://www.chedong.com/phpMan.php/man/strncpy/3/markdown)             Added in POSIX.1-2008 TC2
       [strnlen(3)](https://www.chedong.com/phpMan.php/man/strnlen/3/markdown)             Added in POSIX.1-2008 TC2

       [strpbrk(3)](https://www.chedong.com/phpMan.php/man/strpbrk/3/markdown)             Added in POSIX.1-2008 TC2
       [strrchr(3)](https://www.chedong.com/phpMan.php/man/strrchr/3/markdown)             Added in POSIX.1-2008 TC2
       [strspn(3)](https://www.chedong.com/phpMan.php/man/strspn/3/markdown)              Added in POSIX.1-2008 TC2
       [strstr(3)](https://www.chedong.com/phpMan.php/man/strstr/3/markdown)              Added in POSIX.1-2008 TC2
       [strtok_r(3)](https://www.chedong.com/phpMan.php/man/strtokr/3/markdown)            Added in POSIX.1-2008 TC2
       [symlink(2)](https://www.chedong.com/phpMan.php/man/symlink/2/markdown)
       [symlinkat(2)](https://www.chedong.com/phpMan.php/man/symlinkat/2/markdown)           Added in POSIX.1-2008
       [tcdrain(3)](https://www.chedong.com/phpMan.php/man/tcdrain/3/markdown)
       [tcflow(3)](https://www.chedong.com/phpMan.php/man/tcflow/3/markdown)
       [tcflush(3)](https://www.chedong.com/phpMan.php/man/tcflush/3/markdown)
       [tcgetattr(3)](https://www.chedong.com/phpMan.php/man/tcgetattr/3/markdown)
       [tcgetpgrp(3)](https://www.chedong.com/phpMan.php/man/tcgetpgrp/3/markdown)
       [tcsendbreak(3)](https://www.chedong.com/phpMan.php/man/tcsendbreak/3/markdown)
       [tcsetattr(3)](https://www.chedong.com/phpMan.php/man/tcsetattr/3/markdown)
       [tcsetpgrp(3)](https://www.chedong.com/phpMan.php/man/tcsetpgrp/3/markdown)
       [time(2)](https://www.chedong.com/phpMan.php/man/time/2/markdown)
       [timer_getoverrun(2)](https://www.chedong.com/phpMan.php/man/timergetoverrun/2/markdown)
       [timer_gettime(2)](https://www.chedong.com/phpMan.php/man/timergettime/2/markdown)
       [timer_settime(2)](https://www.chedong.com/phpMan.php/man/timersettime/2/markdown)
       [times(2)](https://www.chedong.com/phpMan.php/man/times/2/markdown)
       [umask(2)](https://www.chedong.com/phpMan.php/man/umask/2/markdown)
       [uname(2)](https://www.chedong.com/phpMan.php/man/uname/2/markdown)
       [unlink(2)](https://www.chedong.com/phpMan.php/man/unlink/2/markdown)
       [unlinkat(2)](https://www.chedong.com/phpMan.php/man/unlinkat/2/markdown)            Added in POSIX.1-2008
       [utime(2)](https://www.chedong.com/phpMan.php/man/utime/2/markdown)
       [utimensat(2)](https://www.chedong.com/phpMan.php/man/utimensat/2/markdown)           Added in POSIX.1-2008
       [utimes(2)](https://www.chedong.com/phpMan.php/man/utimes/2/markdown)              Added in POSIX.1-2008
       [wait(2)](https://www.chedong.com/phpMan.php/man/wait/2/markdown)
       [waitpid(2)](https://www.chedong.com/phpMan.php/man/waitpid/2/markdown)
       [wcpcpy(3)](https://www.chedong.com/phpMan.php/man/wcpcpy/3/markdown)              Added in POSIX.1-2008 TC2
       [wcpncpy(3)](https://www.chedong.com/phpMan.php/man/wcpncpy/3/markdown)             Added in POSIX.1-2008 TC2
       [wcscat(3)](https://www.chedong.com/phpMan.php/man/wcscat/3/markdown)              Added in POSIX.1-2008 TC2
       [wcschr(3)](https://www.chedong.com/phpMan.php/man/wcschr/3/markdown)              Added in POSIX.1-2008 TC2
       [wcscmp(3)](https://www.chedong.com/phpMan.php/man/wcscmp/3/markdown)              Added in POSIX.1-2008 TC2
       [wcscpy(3)](https://www.chedong.com/phpMan.php/man/wcscpy/3/markdown)              Added in POSIX.1-2008 TC2
       [wcscspn(3)](https://www.chedong.com/phpMan.php/man/wcscspn/3/markdown)             Added in POSIX.1-2008 TC2
       [wcslen(3)](https://www.chedong.com/phpMan.php/man/wcslen/3/markdown)              Added in POSIX.1-2008 TC2
       [wcsncat(3)](https://www.chedong.com/phpMan.php/man/wcsncat/3/markdown)             Added in POSIX.1-2008 TC2
       [wcsncmp(3)](https://www.chedong.com/phpMan.php/man/wcsncmp/3/markdown)             Added in POSIX.1-2008 TC2
       [wcsncpy(3)](https://www.chedong.com/phpMan.php/man/wcsncpy/3/markdown)             Added in POSIX.1-2008 TC2
       [wcsnlen(3)](https://www.chedong.com/phpMan.php/man/wcsnlen/3/markdown)             Added in POSIX.1-2008 TC2
       [wcspbrk(3)](https://www.chedong.com/phpMan.php/man/wcspbrk/3/markdown)             Added in POSIX.1-2008 TC2
       [wcsrchr(3)](https://www.chedong.com/phpMan.php/man/wcsrchr/3/markdown)             Added in POSIX.1-2008 TC2
       [wcsspn(3)](https://www.chedong.com/phpMan.php/man/wcsspn/3/markdown)              Added in POSIX.1-2008 TC2
       [wcsstr(3)](https://www.chedong.com/phpMan.php/man/wcsstr/3/markdown)              Added in POSIX.1-2008 TC2
       [wcstok(3)](https://www.chedong.com/phpMan.php/man/wcstok/3/markdown)              Added in POSIX.1-2008 TC2
       [wmemchr(3)](https://www.chedong.com/phpMan.php/man/wmemchr/3/markdown)             Added in POSIX.1-2008 TC2
       [wmemcmp(3)](https://www.chedong.com/phpMan.php/man/wmemcmp/3/markdown)             Added in POSIX.1-2008 TC2
       [wmemcpy(3)](https://www.chedong.com/phpMan.php/man/wmemcpy/3/markdown)             Added in POSIX.1-2008 TC2
       [wmemmove(3)](https://www.chedong.com/phpMan.php/man/wmemmove/3/markdown)            Added in POSIX.1-2008 TC2
       [wmemset(3)](https://www.chedong.com/phpMan.php/man/wmemset/3/markdown)             Added in POSIX.1-2008 TC2
       [write(2)](https://www.chedong.com/phpMan.php/man/write/2/markdown)

       Notes:

       *  POSIX.1-2001 and POSIX.1-2001  TC2  required  the  functions  fpath-
          [conf(3)](https://www.chedong.com/phpMan.php/man/conf/3/markdown),  [pathconf(3)](https://www.chedong.com/phpMan.php/man/pathconf/3/markdown),  and  [sysconf(3)](https://www.chedong.com/phpMan.php/man/sysconf/3/markdown) to be async-signal-safe, but
          this requirement was removed in POSIX.1-2008.

       *  If a signal handler interrupts the execution of an unsafe  function,
          and the handler terminates via a call to [longjmp(3)](https://www.chedong.com/phpMan.php/man/longjmp/3/markdown) or [siglongjmp(3)](https://www.chedong.com/phpMan.php/man/siglongjmp/3/markdown)
          and the program subsequently calls an unsafe function, then the  be-
          havior of the program is undefined.

       *  POSIX.1-2001 TC1 clarified that if an application calls [fork(2)](https://www.chedong.com/phpMan.php/man/fork/2/markdown) from
          a signal  handler  and  any  of  the  fork  handlers  registered  by
          [pthread_atfork(3)](https://www.chedong.com/phpMan.php/man/pthreadatfork/3/markdown)  calls  a  function that is not async-signal-safe,
          the behavior is undefined.  A future revision  of  the  standard  is
          likely  to  remove  [fork(2)](https://www.chedong.com/phpMan.php/man/fork/2/markdown) from the list of async-signal-safe func-
          tions.

       *  Asynchronous signal handlers that call functions which are cancella-
          tion points and nest over regions of deferred cancellation may trig-
          ger cancellation whose behavior is as if  asynchronous  cancellation
          had occurred and may cause application state to become inconsistent.

   errno
       Fetching  and  setting the value of errno is async-signal-safe provided
       that the signal handler saves errno on entry and restores its value be-
       fore returning.

   Deviations in the GNU C library
       The following known deviations from the standard occur in the GNU C li-
       brary:

       *  Before glibc 2.24, [execl(3)](https://www.chedong.com/phpMan.php/man/execl/3/markdown) and [execle(3)](https://www.chedong.com/phpMan.php/man/execle/3/markdown) employed [realloc(3)](https://www.chedong.com/phpMan.php/man/realloc/3/markdown) inter-
          nally  and  were consequently not async-signal-safe.  This was fixed
          in glibc 2.24.

       *  The glibc implementation of [aio_suspend(3)](https://www.chedong.com/phpMan.php/man/aiosuspend/3/markdown) is not  async-signal-safe
          because it uses [pthread_mutex_lock(3)](https://www.chedong.com/phpMan.php/man/pthreadmutexlock/3/markdown) internally.

SEE ALSO
       [sigaction(2)](https://www.chedong.com/phpMan.php/man/sigaction/2/markdown), [signal(7)](https://www.chedong.com/phpMan.php/man/signal/7/markdown), [standards(7)](https://www.chedong.com/phpMan.php/man/standards/7/markdown)

COLOPHON
       This  page  is  part of release 5.10 of the Linux man-pages project.  A
       description of the project, information about reporting bugs,  and  the
       latest     version     of     this    page,    can    be    found    at
       <https://www.kernel.org/doc/man-pages/>.

Linux                             2020-12-21                  [SIGNAL-SAFETY(7)](https://www.chedong.com/phpMan.php/man/SIGNAL-SAFETY/7/markdown)
