summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2019-06-27 16:30:39 +0000
committerschwarze <>2019-06-27 16:30:39 +0000
commit7428bb5ee53696fd7fb6e551a60b65c715f0b64f (patch)
tree260d179469bbc6c46dd74756d56dc6901875590a /src
parent2fcc42bbd981d41372ccd00c22185ea1559bcb97 (diff)
downloadopenbsd-7428bb5ee53696fd7fb6e551a60b65c715f0b64f.tar.gz
openbsd-7428bb5ee53696fd7fb6e551a60b65c715f0b64f.tar.bz2
openbsd-7428bb5ee53696fd7fb6e551a60b65c715f0b64f.zip
The C89 standard only requires that atexit(3) returns a non-zero value
on error, so checking for -1 only is potentially non-portable. Also mention that the C89 standard does not require errno to be set. OK deraadt@ millert@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/stdlib/atexit.317
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib/libc/stdlib/atexit.3 b/src/lib/libc/stdlib/atexit.3
index d428149de5..a95a45b92e 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.11 2015/05/12 20:14:09 guenther Exp $ 32.\" $OpenBSD: atexit.3,v 1.12 2019/06/27 16:30:39 schwarze Exp $
33.\" 33.\"
34.Dd $Mdocdate: May 12 2015 $ 34.Dd $Mdocdate: June 27 2019 $
35.Dt ATEXIT 3 35.Dt ATEXIT 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -70,7 +70,12 @@ is very difficult to use correctly without creating
70races. 70races.
71Unless absolutely necessary, please avoid using it. 71Unless absolutely necessary, please avoid using it.
72.Sh RETURN VALUES 72.Sh RETURN VALUES
73.Rv -std atexit 73The
74.Nm
75function returns the value 0 if successful; otherwise a non-zero
76value is returned and the global variable
77.Va errno
78is set to indicate the error.
74.Sh ERRORS 79.Sh ERRORS
75.Bl -tag -width Er 80.Bl -tag -width Er
76.It Bq Er ENOMEM 81.It Bq Er ENOMEM
@@ -86,5 +91,7 @@ The
86function conforms to 91function conforms to
87.St -ansiC . 92.St -ansiC .
88.Pp 93.Pp
89The behavior when a shared object is unloaded is an extension to 94Setting
90that standard. 95.Va errno
96on error and the behavior when a shared object is unloaded
97are extensions to that standard.