This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[MTASCsft PATCH WIP5 28/33] MT-, AS- and AC-safety docs: manual/startup.texi


for ChangeLog

	* manual/startup.texi: Document MTASC-safety properties.
---
 manual/startup.texi |   26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/manual/startup.texi b/manual/startup.texi
index a277714..93be2af 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.
 
@@ -372,6 +376,24 @@ available in old SVID libraries you should define either
 @comment stdlib.h
 @comment BSD
 @deftypefun int setenv (const char *@var{name}, const char *@var{value}, int @var{replace})
+@safety{@mtsafe{}@asunsafe{asmalloc, selfdeadlock}@acunsafe{incansist, lockleak, memleak}}
+@c setenv asmalloc, selfdeadlock, incansist, lockleak, memleak
+@c  add_to_environ asmalloc, selfdeadlock, incansist, lockleak, memleak
+@c   strlen dup ok
+@c   libc_lock_lock selfdeadlock, lockleak
+@c   strncmp dup ok
+@c   realloc dup asmalloc, memleak
+@c   libc_lock_unlock lockleak
+@c   malloc dup asmalloc, memleak
+@c   free dup asmalloc, memleak
+@c   mempcpy dup ok
+@c   memcpy dup ok
+@c   KNOWN_VALUE ok
+@c    tfind(strcmp) [no xguargs, guarded access]
+@c     strcmp dup ok
+@c   STORE_VALUE asmalloc, incansist, memleak
+@c    tsearch(strcmp) asmalloc, incansist, memleak [no xguargs or asynconsist, guarded access makes for mtsafe and selfdeadlock]
+@c     strcmp dup ok
 The @code{setenv} function can be used to add a new definition to the
 environment.  The entry with the name @var{name} is replaced by the
 value @samp{@var{name}=@var{value}}.  Please note that this is also true


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]