From: Michael Kerrisk <mtk.manpages-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
To: gsauthof-If1cxaH3S3JVgF+RW+Bo1SZEdBbF94EN@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: setenv may set errno
Date: Sun, 20 Sep 2009 05:01:38 +0200 [thread overview]
Message-ID: <cfd18e0f0909192001g79154e7axe123e77901e7cbb2@mail.gmail.com> (raw)
In-Reply-To: <20090908091236.GF15639-tjyxa8jfGxeYtgw7cXKeDw@public.gmane.org>
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
prev parent reply other threads:[~2009-09-20 3:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cfd18e0f0909192001g79154e7axe123e77901e7cbb2@mail.gmail.com \
--to=mtk.manpages-gm/ye1e23mwn+bqq9rbeug@public.gmane.org \
--cc=gsauthof-If1cxaH3S3JVgF+RW+Bo1SZEdBbF94EN@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox