From 2a4b81ffd40e2888030bd1e8d1632def6b7fb256 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 20 Sep 2009 04:56:47 +0200 Subject: [PATCH] setenv.3: Improve ERRORS section Add ENOMEM error; improve EINVAL description. Also, make RETURN VALUE section a little more accurate in its mention of errno. Reported-by: Georg Sauthoff Signed-off-by: Michael Kerrisk --- man3/setenv.3 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/man3/setenv.3 b/man3/setenv.3 index f9bd5bed2..d989f3c2b 100644 --- a/man3/setenv.3 +++ b/man3/setenv.3 @@ -32,7 +32,7 @@ .\" Noted non-standard behavior of setenv() if name contains '=' .\" 2005-08-12, mtk, glibc 2.3.4 fixed the "name contains '='" bug .\" -.TH SETENV 3 2007-07-26 "GNU" "Linux Programmer's Manual" +.TH SETENV 3 2009-09-20 "GNU" "Linux Programmer's Manual" .SH NAME setenv \- change or add an environment variable .SH SYNOPSIS @@ -82,8 +82,10 @@ then the function succeeds, and the environment is unchanged. .SH "RETURN VALUE" The .BR setenv () -function returns zero on success, or \-1 if there -was insufficient space in the environment. +function returns zero on success, +or \-1 on error, with +.I errno +set to indicate the cause of the error. The .BR unsetenv () @@ -95,7 +97,11 @@ set to indicate the cause of the error. .TP .B EINVAL .I name -contained an \(aq=\(aq character. +is NULL, points to a string of length 0, +or contains an \(aq=\(aq character. +.TP +.B ENOMEM +Insufficient memory to add a new variable to the environment. .SH "CONFORMING TO" 4.3BSD, POSIX.1-2001. .SH "NOTES"