diff --git a/man3/atexit.3 b/man3/atexit.3 index bccba30d1..4a9a2e5d2 100644 --- a/man3/atexit.3 +++ b/man3/atexit.3 @@ -85,6 +85,23 @@ and the other process termination steps performed by .BR exit (3) are not performed. +POSIX.1-2001 says that the result of calling +.BR exit (3) +more than once (i.e., calling +.BR exit (3) +within a function registered using +.BR atexit (3)) +is undefined. +On some systems (but not Linux), this can result in an infinite recursion; +.\" This can happen on OpenBSD 4.2 for example, and is documented +.\" as occurring on FreeBSD as well. +.\" Glibc does "the Right Thing" -- invocation of the remaining +.\" exit handlers carries on as normal. +portable programs should not invoke +.BR exit (3) +inside a function registered using +.BR atexit (3). + The .BR atexit () and