* setenv may set errno
@ 2009-09-08 9:12 gsauthof-If1cxaH3S3JVgF+RW+Bo1SZEdBbF94EN
[not found] ` <20090908091236.GF15639-tjyxa8jfGxeYtgw7cXKeDw@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: gsauthof-If1cxaH3S3JVgF+RW+Bo1SZEdBbF94EN @ 2009-09-08 9:12 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
Hi,
in setenv(3) in the section 'RETURN VALUE' it is not mentioned, that
setenv() may set errno. For unsetenv() the section mentions this.
Best regards
Georg Sauthoff
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: setenv may set errno
[not found] ` <20090908091236.GF15639-tjyxa8jfGxeYtgw7cXKeDw@public.gmane.org>
@ 2009-09-20 3:01 ` Michael Kerrisk
0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk @ 2009-09-20 3:01 UTC (permalink / raw)
To: gsauthof-If1cxaH3S3JVgF+RW+Bo1SZEdBbF94EN
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
Hello Georg,
On Tue, Sep 8, 2009 at 11:12 AM, <gsauthof-If1cxaH3S3JVgF+RW+Bo1SZEdBbF94EN@public.gmane.org> 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-20 3:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-08 9:12 setenv may set errno gsauthof-If1cxaH3S3JVgF+RW+Bo1SZEdBbF94EN
[not found] ` <20090908091236.GF15639-tjyxa8jfGxeYtgw7cXKeDw@public.gmane.org>
2009-09-20 3:01 ` Michael Kerrisk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox