1 --- getenv.3 2004-11-25 11:38:41.000000000 -0800
2 +++ getenv.3.edit 2006-09-17 20:33:52.000000000 -0700
7 -.Fn getenv "const char *name"
9 +.Fa "const char *name"
12 -.Fn setenv "const char *name" "const char *value" "int overwrite"
17 -.Fn putenv "const char *string"
19 -.Fn unsetenv "const char *name"
21 +.Fa "const char *name"
22 +.Fa "const char *value"
27 +.Fa "const char *name"
30 These functions set, unset and fetch environment variables from the
33 setenv(name, value, 1);
36 +The string pointed to by
38 +becomes part of the environment.
39 +A program should not alter or free the string,
40 +and should not use stack or other transient string variables
45 +function is strongly preferred to
51 deletes all instances of the variable name pointed to by
54 +Note that only the variable name (e.g., "NAME") should be given;
55 +"NAME=value" will not work.
63 -.Rv -std setenv putenv
64 +.Rv -std setenv putenv unsetenv
72 +was not found in the environment list.
78 -failed because they were unable to allocate memory for the environment.
79 +failed because it was unable to allocate memory for the environment.
82 +.Fd #include <stdlib.h>
87 +.Fa "const char *name"
91 +doesn't return a value.
94 +no longer copies its input buffer.
95 +This often appears in crash logs as a crash in
97 +Avoid passing local buffers or freeing the memory
102 +which still makes an internal copy of its buffers.
105 +no longer parses the variable name;
106 +e.g., unsetenv ("FOO=BAR") no longer works.
107 +Use unsetenv("FOO").
109 +also now returns a status value and will set
113 +is not a defined environment variable.