summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/getenv.3
diff options
context:
space:
mode:
authoraaron <aaron@openbsd.org>2000-04-20 13:50:01 +0000
committeraaron <aaron@openbsd.org>2000-04-20 13:50:01 +0000
commitb43b90887f3b9d2c29965f870f90ae22a8c39b03 (patch)
tree30c566895531f29f7cd76f7a66a745b31029b375 /lib/libc/stdlib/getenv.3
parentDon't include machine/pmap.h, vm/pmap.h does that for us. (diff)
downloadwireguard-openbsd-b43b90887f3b9d2c29965f870f90ae22a8c39b03.tar.xz
wireguard-openbsd-b43b90887f3b9d2c29965f870f90ae22a8c39b03.zip
Flesh out stdlib function man pages.
Diffstat (limited to 'lib/libc/stdlib/getenv.3')
-rw-r--r--lib/libc/stdlib/getenv.333
1 files changed, 12 insertions, 21 deletions
diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3
index d6ffc8b1ddd..b2aa0080d67 100644
--- a/lib/libc/stdlib/getenv.3
+++ b/lib/libc/stdlib/getenv.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: getenv.3,v 1.6 1999/09/06 23:26:30 aaron Exp $
+.\" $OpenBSD: getenv.3,v 1.7 2000/04/20 13:50:02 aaron Exp $
.\"
.Dd December 11, 1993
.Dt GETENV 3
@@ -55,17 +55,13 @@
.Ft void
.Fn unsetenv "const char *name"
.Sh DESCRIPTION
-These functions set, unset and fetch environment variables from the
-host
+These functions set, unset, and fetch environment variables from the host
.Em environment list .
-For compatibility with differing environment conventions,
-the given arguments
+For compatibility with differing environment conventions, the given arguments
.Fa name
and
.Fa value
-may be appended and prepended,
-respectively,
-with an equal sign
+may be appended and prepended, respectively, with an equal sign
.Dq Li \&= .
.Pp
The
@@ -74,8 +70,7 @@ function obtains the current value of the environment variable,
.Fa name .
If the variable
.Fa name
-is not in the current environment,
-a null pointer is returned.
+is not in the current environment, a null pointer is returned.
.Pp
The
.Fn setenv
@@ -84,30 +79,27 @@ function inserts or resets the environment variable
in the current environment list.
If the variable
.Fa name
-does not exist in the list,
-it is inserted with the given
+does not exist in the list, it is inserted with the given
.Fa value .
If the variable does exist, the argument
.Fa overwrite
is tested; if
.Fa overwrite
-is zero,
-the variable is not reset, otherwise it is reset
-to the given
+is zero, the variable is not reset, otherwise it is reset to the given
.Fa value .
.Pp
The
.Fn putenv
-function takes an argument of the form ``name=value'' and is
-equivalent to:
+function takes an argument of the form
+.Ar name Ns No = Ns Ar value
+and is equivalent to:
.Bd -literal -offset indent
setenv(name, value, 1);
.Ed
.Pp
The
.Fn unsetenv
-function
-deletes all instances of the variable name pointed to by
+function deletes all instances of the variable name pointed to by
.Fa name
from the list.
.Sh RETURN VALUES
@@ -117,8 +109,7 @@ and
.Fn putenv
return zero if successful; otherwise the global variable
.Va errno
-is set to indicate the error and a
-\-1 is returned.
+is set to indicate the error and \-1 is returned.
.Pp
If
.Fn getenv