This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[MTASCsft PATCH WIP4 23/28] Thread safety documentation.
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: libc-alpha at sourceware dot org
- Cc: carlos at redhat dot com, mtk dot manpages at gmail dot com
- Date: Sat, 12 Oct 2013 04:13:26 -0300
- Subject: [MTASCsft PATCH WIP4 23/28] Thread safety documentation.
- Authentication-results: sourceware.org; auth=none
- References: <20131012070020 dot 7511 dot 90546 dot stgit at frit dot home>
for ChangeLog
* manual/startup.texi: Document thread safety properties.
---
manual/startup.texi | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/manual/startup.texi b/manual/startup.texi
index a277714..d3b52d5 100644
--- a/manual/startup.texi
+++ b/manual/startup.texi
@@ -322,6 +322,8 @@ functions can be safely used in multi-threaded programs.
@comment stdlib.h
@comment ISO
@deftypefun {char *} getenv (const char *@var{name})
+@safety{@mtunsafe{envromt}@assafe{}@acsafe{}}
+@c Unguarded access to __environ.
This function returns a string that is the value of the environment
variable @var{name}. You must not modify this string. In some non-Unix
systems not using @theglibc{}, it might be overwritten by subsequent
@@ -333,6 +335,8 @@ pointer.
@comment stdlib.h
@comment GNU
@deftypefun {char *} secure_getenv (const char *@var{name})
+@safety{@mtunsafe{envromt}@assafe{}@acsafe{}}
+@c Calls getenv unless secure mode is enabled.
This function is similar to @code{getenv}, but it returns a null
pointer if the environment is untrusted. This happens when the
program file has SUID or SGID bits set. General-purpose libraries
@@ -358,8 +362,8 @@ value is nonzero and @code{errno} is set to indicate the error.
The difference to the @code{setenv} function is that the exact string
given as the parameter @var{string} is put into the environment. If the
user should change the string after the @code{putenv} call this will
-reflect in automatically in the environment. This also requires that
-@var{string} is no automatic variable which scope is left before the
+reflect automatically in the environment. This also requires that
+@var{string} not be an automatic variable whose scope is left before the
variable is removed from the environment. The same applies of course to
dynamically allocated variables which are freed later.