exit(3) Library Functions Manual exit(3) exit - LIBRARY Standard C library (libc, -lc) #include [[noreturn]] void exit(int status); The exit() function causes normal process termination and the least significant byte of status (i.e., status & 0xFF) is returned to the parent (see wait(2)). , atexit(3) on_exit(3), ( atexit(3) on_exit(3) , ; , ). (, _exit(2) ), , ( , stdio(3)). atexit(3) on_exit(3) , , . stdio(3) . , tmpfile(3), . , EXIT_SUCCESS EXIT_FAILURE, exit() , . exit() . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |exit() | | MT-Unsafe race:exit | +----------------------------+----------------------------------------------------------+--------------------------+ exit() , . C11, POSIX.1-2008. C89, POSIX.1-2001, SVr4, 4.3BSD. , , atexit(3) on_exit(3), exit() longjmp(3). , execve(2) , atexit(3) on_exit(3). EXIT_SUCCESS EXIT_FAILURE ( -UNIX ), 0 - (, 1 -1). , VMS . BSD ( , GNU C); . exit() . : o SA_NOCLDWAIT SIGCHLD SIG_IGN, . o , . o <<>>: , - ( , ) . waitpid(2) ( ) ; - . SIGCHLD, . SA_NOCLDWAIT, SIGCHLD . , , SIGHUP, , . , , SIGHUP SIGCONT. setpgid(2). , , , , , , . , prctl(2) PR_SET_PDEATHSIG, , . . _exit(2), get_robust_list(2), setpgid(2), wait(2), atexit(3), on_exit(3), tmpfile(3) Azamat Hackimov , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . exit(3)