aboutsummaryrefslogtreecommitdiffstats
path: root/man/man3/putenv.3
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-07-17 22:43:18 +0200
committerAlejandro Colomar <alx@kernel.org>2025-03-30 12:31:37 +0200
commita82917ada0509758ac6d717402858536af3a032d (patch)
treece8bc810a6c9f2f0ef5c7641392613d6b8a2ed0e /man/man3/putenv.3
parentc47826785d91e9cd8c2957d789e50a50e36833e0 (diff)
downloadman-pages-a82917ada0509758ac6d717402858536af3a032d.tar.gz
man/: srcfix (\fX => \f[X])
While doing this global change, fix other minor issues found nearby. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man/man3/putenv.3')
-rw-r--r--man/man3/putenv.348
1 files changed, 35 insertions, 13 deletions
diff --git a/man/man3/putenv.3 b/man/man3/putenv.3
index 0368af6697..f3ed51b8f8 100644
--- a/man/man3/putenv.3
+++ b/man/man3/putenv.3
@@ -44,13 +44,25 @@ The
.BR putenv ()
function adds or changes the value of environment
variables.
-The argument \fIstring\fP is of the form \fIname\fP=\fIvalue\fP.
-If \fIname\fP does not already exist in the environment, then
-\fIstring\fP is added to the environment.
-If \fIname\fP does exist,
-then the value of \fIname\fP in the environment is changed to
-\fIvalue\fP.
-The string pointed to by \fIstring\fP becomes part of the environment,
+The argument
+.I string
+is of the form
+.IR name = value .
+If
+.I name
+does not already exist in the environment, then
+.I string
+is added to the environment.
+If
+.I name
+does exist,
+then the value of
+.I name
+in the environment is changed to
+.IR value .
+The string pointed to by
+.I string
+becomes part of the environment,
so altering the string changes the environment.
.SH RETURN VALUE
The
@@ -88,12 +100,17 @@ function is not required to be reentrant, and the
one in glibc 2.0 is not, but the glibc 2.1 version is.
.\" .P
.\" Description for libc4, libc5, glibc:
-.\" If the argument \fIstring\fP is of the form \fIname\fP,
-.\" and does not contain an \[aq]=\[aq] character, then the variable \fIname\fP
+.\" If the argument
+.\" .I string
+.\" is of the form
+.\" .IR name ,
+.\" and does not contain an \[aq]=\[aq] character, then the variable
+.\" .I name
.\" is removed from the environment.
.\" If
.\" .BR putenv ()
-.\" has to allocate a new array \fIenviron\fP,
+.\" has to allocate a new array
+.\" .IR environ ,
.\" and the previous array was also allocated by
.\" .BR putenv (),
.\" then it will be freed.
@@ -101,7 +118,9 @@ one in glibc 2.0 is not, but the glibc 2.1 version is.
.\" to the environment variable itself be freed.
.P
Since glibc 2.1.2, the glibc implementation conforms to SUSv2:
-the pointer \fIstring\fP given to
+the pointer
+.I string
+given to
.BR putenv ()
is used.
In particular, this string becomes part of the environment;
@@ -109,7 +128,8 @@ changing it later will change the environment.
(Thus, it is an error to call
.BR putenv ()
with an automatic variable
-as the argument, then return from the calling function while \fIstring\fP
+as the argument, then return from the calling function while
+.I string
is still part of the environment.)
However, from glibc 2.0 to glibc 2.1.1, it differs:
a copy of the string is used.
@@ -119,7 +139,9 @@ it violates SUSv2.
The 4.3BSD-Reno version, like glibc 2.0, uses a copy;
this is fixed in all modern BSDs.
.P
-SUSv2 removes the \fIconst\fP from the prototype, and so does glibc 2.1.3.
+SUSv2 removes the
+.I const
+from the prototype, and so does glibc 2.1.3.
.P
The GNU C library implementation provides a nonstandard extension.
If