1 --- atexit.3.bsdnew 2009-11-13 14:11:47.000000000 -0800
2 +++ atexit.3 2009-11-13 14:11:47.000000000 -0800
4 .\" @(#)atexit.3 8.1 (Berkeley) 6/4/93
5 .\" $FreeBSD: src/lib/libc/stdlib/atexit.3,v 1.11 2007/01/09 00:28:09 imp Exp $
13 .Nd register a function to be called on exit
19 -.Fn atexit "void (*function)(void)"
20 +.Fn atexit "void (*func)(void)"
21 +#ifdef UNIFDEF_BLOCKS
23 +.Fn atexit_b "void (^block)(void)"
31 +registers the function
33 to be called at program exit, whether via
35 or via return from the program's
37 Functions so registered are called in reverse order;
38 no arguments are passed.
39 +#ifdef UNIFDEF_BLOCKS
45 +except the callback is a block pointer instead of a function pointer.
46 +.Bd -ragged -offset indent
53 +to make a copy of the block, especially for the case when a stack-based
54 +block might go out of scope when the subroutine returns.
58 -These functions must not call
59 +These callbacks must not call
61 if it should be necessary to terminate the process while in such a
64 function should be used.
65 -(Alternatively, the function may cause abnormal
66 +(Alternatively, the callbacks may cause abnormal
67 process termination, for example by calling
70 -At least 32 functions can always be registered,
71 -and more are allowed as long as sufficient memory can be allocated.
72 +At least 32 callbacks can always be registered;
73 +more are allowed as long as sufficient memory can be allocated.
74 .\" XXX {ATEXIT_MAX} is not implemented yet
77 +#ifdef UNIFDEF_BLOCKS
78 +.ds ATEXIT_B atexit_b
80 +.Rv -std atexit \*[ATEXIT_B]