diff options
author | sheldonh <sheldonh@FreeBSD.org> | 1999-12-22 17:04:46 +0000 |
---|---|---|
committer | sheldonh <sheldonh@FreeBSD.org> | 1999-12-22 17:04:46 +0000 |
commit | 54243b8e7a46e67ff40d26183c2c897e3a6a3158 (patch) | |
tree | d992627c07c0c4c0d1306f3782e5525621076264 /lib/libc/stdlib/malloc.3 | |
parent | 608430714f0e44bdc162fd95a40da5244b47b034 (diff) | |
download | FreeBSD-src-54243b8e7a46e67ff40d26183c2c897e3a6a3158.zip FreeBSD-src-54243b8e7a46e67ff40d26183c2c897e3a6a3158.tar.gz |
Document the current behaviour with respect to the handling of errno.
Approved by: phk
Diffstat (limited to 'lib/libc/stdlib/malloc.3')
-rw-r--r-- | lib/libc/stdlib/malloc.3 | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3 index 764bad1..f4e75e2 100644 --- a/lib/libc/stdlib/malloc.3 +++ b/lib/libc/stdlib/malloc.3 @@ -264,7 +264,10 @@ The and .Fn calloc functions return a pointer to the allocated memory if successful; otherwise -a NULL pointer is returned. +a NULL pointer is returned and +.Va errno +is set to +.Er ENOMEM . .Pp The .Fn realloc @@ -277,6 +280,10 @@ if successful; otherwise a NULL pointer is returned, in which case the memory referenced by .Fa ptr is still available and intact. +In the case of memory allocation failure, +.Va errno +is set to +.Er ENOMEM . .Pp The .Fn free |