diff options
| author | schwarze <> | 2019-06-27 16:30:39 +0000 |
|---|---|---|
| committer | schwarze <> | 2019-06-27 16:30:39 +0000 |
| commit | a9c88893397c680a5d550e651f7ee45ce7bd174a (patch) | |
| tree | 260d179469bbc6c46dd74756d56dc6901875590a /src/lib/libc/stdlib | |
| parent | 0ecfd00f8b373ea27ad0d82d84c25c6f8d36a695 (diff) | |
| download | openbsd-a9c88893397c680a5d550e651f7ee45ce7bd174a.tar.gz openbsd-a9c88893397c680a5d550e651f7ee45ce7bd174a.tar.bz2 openbsd-a9c88893397c680a5d550e651f7ee45ce7bd174a.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/lib/libc/stdlib')
| -rw-r--r-- | src/lib/libc/stdlib/atexit.3 | 17 |
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 | |||
| 70 | races. | 70 | races. |
| 71 | Unless absolutely necessary, please avoid using it. | 71 | Unless absolutely necessary, please avoid using it. |
| 72 | .Sh RETURN VALUES | 72 | .Sh RETURN VALUES |
| 73 | .Rv -std atexit | 73 | The |
| 74 | .Nm | ||
| 75 | function returns the value 0 if successful; otherwise a non-zero | ||
| 76 | value is returned and the global variable | ||
| 77 | .Va errno | ||
| 78 | is 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 | |||
| 86 | function conforms to | 91 | function conforms to |
| 87 | .St -ansiC . | 92 | .St -ansiC . |
| 88 | .Pp | 93 | .Pp |
| 89 | The behavior when a shared object is unloaded is an extension to | 94 | Setting |
| 90 | that standard. | 95 | .Va errno |
| 96 | on error and the behavior when a shared object is unloaded | ||
| 97 | are extensions to that standard. | ||
