From 393333febcecdc8049bd3c7c6f9aac75c3563226 Mon Sep 17 00:00:00 2001 From: mike Date: Sun, 23 Sep 2001 00:37:42 +0000 Subject: Note that strdup(3) will set errno if memory allocation fails. This is also required by the forthcoming POSIX.1-200x standard. Obtained from: malloc.3 --- lib/libc/string/strdup.3 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/libc/string') diff --git a/lib/libc/string/strdup.3 b/lib/libc/string/strdup.3 index a0139d3..c582a70 100644 --- a/lib/libc/string/strdup.3 +++ b/lib/libc/string/strdup.3 @@ -56,7 +56,10 @@ The pointer may subsequently be used as an argument to the function .Xr free 3 . .Pp -If insufficient memory is available, NULL is returned. +If insufficient memory is available, NULL is returned and +.Va errno +is set to +.Er ENOMEM . .Sh SEE ALSO .Xr free 3 , .Xr malloc 3 -- cgit v1.1