aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/getenv.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/getenv.3')
-rw-r--r--lib/libc/stdlib/getenv.320
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3
index e662b86d214b..5566d7b01dcd 100644
--- a/lib/libc/stdlib/getenv.3
+++ b/lib/libc/stdlib/getenv.3
@@ -32,10 +32,11 @@
.\" @(#)getenv.3 8.2 (Berkeley) 12/11/93
.\" $FreeBSD$
.\"
-.Dd June 20, 2007
+.Dd November 7, 2021
.Dt GETENV 3
.Os
.Sh NAME
+.Nm clearenv ,
.Nm getenv ,
.Nm putenv ,
.Nm setenv ,
@@ -45,6 +46,8 @@
.Lb libc
.Sh SYNOPSIS
.In stdlib.h
+.Ft int
+.Fn clearenv "void"
.Ft char *
.Fn getenv "const char *name"
.Ft int
@@ -59,6 +62,14 @@ host
.Em environment list .
.Pp
The
+.Fn clearenv
+function clears all environment variables.
+New variables can be added using
+.Fn setenv
+and
+.Fn putenv .
+.Pp
+The
.Fn getenv
function obtains the current value of the environment variable,
.Fa name .
@@ -128,7 +139,7 @@ is not in the current environment,
.Dv NULL
is returned.
.Pp
-.Rv -std setenv putenv unsetenv
+.Rv -std clearenv setenv putenv unsetenv
.Sh ERRORS
.Bl -tag -width Er
.It Bq Er EINVAL
@@ -211,6 +222,11 @@ This was changed to use
as the memory location of the ``name=value'' pair to follow the
.Tn POSIX
specification.
+.Pp
+The
+.Fn clearenv
+was added in
+.Fx 14 .
.Sh BUGS
Successive calls to
.Fn setenv