on_exit(3) Library Functions Manual on_exit(3) on_exit - C (libc, -lc) #include int on_exit(typeof(void (int, void *)) *function, void *arg); glibc (. feature_test_macros(7)): on_exit(): glibc 2.19: _DEFAULT_SOURCE glibc 2.19 : _BSD_SOURCE || _SVID_SOURCE on_exit() function exit(3) main(). function , exit(3), arg on_exit(). : . fork(2), . exec(3) . The on_exit() function returns the value 0 if successful; otherwise, it returns a nonzero value. attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |on_exit() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ . SunOS 4, glibc. Removed in Solaris (SunOS 5). Use the standard atexit(3) instead. CAVEATS function (auto) . arg ; . _exit(2), atexit(3), exit(3) () Azamat Hackimov , Konstantin Shvaykovskiy , Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () . Linux man-pages 6.18 8 2026 . on_exit(3)