diff options
Diffstat (limited to 'src/lib/libc/stdlib/getenv.3')
-rw-r--r-- | src/lib/libc/stdlib/getenv.3 | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/src/lib/libc/stdlib/getenv.3 b/src/lib/libc/stdlib/getenv.3 index d6ffc8b1dd..b2aa0080d6 100644 --- a/src/lib/libc/stdlib/getenv.3 +++ b/src/lib/libc/stdlib/getenv.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: getenv.3,v 1.6 1999/09/06 23:26:30 aaron Exp $ | 36 | .\" $OpenBSD: getenv.3,v 1.7 2000/04/20 13:50:02 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd December 11, 1993 | 38 | .Dd December 11, 1993 |
39 | .Dt GETENV 3 | 39 | .Dt GETENV 3 |
@@ -55,17 +55,13 @@ | |||
55 | .Ft void | 55 | .Ft void |
56 | .Fn unsetenv "const char *name" | 56 | .Fn unsetenv "const char *name" |
57 | .Sh DESCRIPTION | 57 | .Sh DESCRIPTION |
58 | These functions set, unset and fetch environment variables from the | 58 | These functions set, unset, and fetch environment variables from the host |
59 | host | ||
60 | .Em environment list . | 59 | .Em environment list . |
61 | For compatibility with differing environment conventions, | 60 | For compatibility with differing environment conventions, the given arguments |
62 | the given arguments | ||
63 | .Fa name | 61 | .Fa name |
64 | and | 62 | and |
65 | .Fa value | 63 | .Fa value |
66 | may be appended and prepended, | 64 | may be appended and prepended, respectively, with an equal sign |
67 | respectively, | ||
68 | with an equal sign | ||
69 | .Dq Li \&= . | 65 | .Dq Li \&= . |
70 | .Pp | 66 | .Pp |
71 | The | 67 | The |
@@ -74,8 +70,7 @@ function obtains the current value of the environment variable, | |||
74 | .Fa name . | 70 | .Fa name . |
75 | If the variable | 71 | If the variable |
76 | .Fa name | 72 | .Fa name |
77 | is not in the current environment, | 73 | is not in the current environment, a null pointer is returned. |
78 | a null pointer is returned. | ||
79 | .Pp | 74 | .Pp |
80 | The | 75 | The |
81 | .Fn setenv | 76 | .Fn setenv |
@@ -84,30 +79,27 @@ function inserts or resets the environment variable | |||
84 | in the current environment list. | 79 | in the current environment list. |
85 | If the variable | 80 | If the variable |
86 | .Fa name | 81 | .Fa name |
87 | does not exist in the list, | 82 | does not exist in the list, it is inserted with the given |
88 | it is inserted with the given | ||
89 | .Fa value . | 83 | .Fa value . |
90 | If the variable does exist, the argument | 84 | If the variable does exist, the argument |
91 | .Fa overwrite | 85 | .Fa overwrite |
92 | is tested; if | 86 | is tested; if |
93 | .Fa overwrite | 87 | .Fa overwrite |
94 | is zero, | 88 | is zero, the variable is not reset, otherwise it is reset to the given |
95 | the variable is not reset, otherwise it is reset | ||
96 | to the given | ||
97 | .Fa value . | 89 | .Fa value . |
98 | .Pp | 90 | .Pp |
99 | The | 91 | The |
100 | .Fn putenv | 92 | .Fn putenv |
101 | function takes an argument of the form ``name=value'' and is | 93 | function takes an argument of the form |
102 | equivalent to: | 94 | .Ar name Ns No = Ns Ar value |
95 | and is equivalent to: | ||
103 | .Bd -literal -offset indent | 96 | .Bd -literal -offset indent |
104 | setenv(name, value, 1); | 97 | setenv(name, value, 1); |
105 | .Ed | 98 | .Ed |
106 | .Pp | 99 | .Pp |
107 | The | 100 | The |
108 | .Fn unsetenv | 101 | .Fn unsetenv |
109 | function | 102 | function deletes all instances of the variable name pointed to by |
110 | deletes all instances of the variable name pointed to by | ||
111 | .Fa name | 103 | .Fa name |
112 | from the list. | 104 | from the list. |
113 | .Sh RETURN VALUES | 105 | .Sh RETURN VALUES |
@@ -117,8 +109,7 @@ and | |||
117 | .Fn putenv | 109 | .Fn putenv |
118 | return zero if successful; otherwise the global variable | 110 | return zero if successful; otherwise the global variable |
119 | .Va errno | 111 | .Va errno |
120 | is set to indicate the error and a | 112 | is set to indicate the error and \-1 is returned. |
121 | \-1 is returned. | ||
122 | .Pp | 113 | .Pp |
123 | If | 114 | If |
124 | .Fn getenv | 115 | .Fn getenv |