diff options
Diffstat (limited to 'src/lib/libc')
| -rw-r--r-- | src/lib/libc/stdlib/atexit.3 | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/atexit.3 b/src/lib/libc/stdlib/atexit.3 index 8e3ac3e60f..c4f56c90fa 100644 --- a/src/lib/libc/stdlib/atexit.3 +++ b/src/lib/libc/stdlib/atexit.3 | |||
| @@ -29,9 +29,9 @@ | |||
| 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
| 31 | .\" | 31 | .\" |
| 32 | .\" $OpenBSD: atexit.3,v 1.9 2013/06/05 03:39:23 tedu Exp $ | 32 | .\" $OpenBSD: atexit.3,v 1.10 2014/11/20 04:55:43 guenther Exp $ |
| 33 | .\" | 33 | .\" |
| 34 | .Dd $Mdocdate: June 5 2013 $ | 34 | .Dd $Mdocdate: November 20 2014 $ |
| 35 | .Dt ATEXIT 3 | 35 | .Dt ATEXIT 3 |
| 36 | .Os | 36 | .Os |
| 37 | .Sh NAME | 37 | .Sh NAME |
| @@ -55,6 +55,15 @@ no arguments are passed. | |||
| 55 | At least 32 functions can always be registered, | 55 | At least 32 functions can always be registered, |
| 56 | and more are allowed as long as sufficient memory can be allocated. | 56 | and more are allowed as long as sufficient memory can be allocated. |
| 57 | .Pp | 57 | .Pp |
| 58 | If a shared object is unloaded from process memory using | ||
| 59 | .Xr dlclose 3 , | ||
| 60 | then any functions registered by calling | ||
| 61 | .Fn atexit | ||
| 62 | from that shared object will be called in reverse order and unregistered. | ||
| 63 | Note that it is the source of the call to | ||
| 64 | .Fn atexit | ||
| 65 | that matters, not the source of the function that was registered. | ||
| 66 | .Pp | ||
| 58 | .Fn atexit | 67 | .Fn atexit |
| 59 | is very difficult to use correctly without creating | 68 | is very difficult to use correctly without creating |
| 60 | .Xr exit 3 Ns -time | 69 | .Xr exit 3 Ns -time |
| @@ -75,3 +84,6 @@ The | |||
| 75 | .Fn atexit | 84 | .Fn atexit |
| 76 | function conforms to | 85 | function conforms to |
| 77 | .St -ansiC . | 86 | .St -ansiC . |
| 87 | .Pp | ||
| 88 | The behavior when a shared object is unloaded is an extension to | ||
| 89 | that standard. | ||
