diff options
Diffstat (limited to 'lib/libc/stdlib')
| -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 764bad1033de..f4e75e2f748f 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 |
