Re: setenv may set errno

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Georg,

On Tue, Sep 8, 2009 at 11:12 AM,  <gsauthof@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Hi,
>
> in setenv(3) in the section 'RETURN VALUE' it is not mentioned, that
> setenv() may set errno. For unsetenv() the section mentions this.

Thanks! Your comment actually triggered a few other changes as well.
See the patc below, which will be in man-pages-3.22.

Cheers,

Michael


--- a/man3/setenv.3
+++ b/man3/setenv.3
@@ -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"




-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Watch my Linux system programming book progress to publication!
http://blog.man7.org/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux