diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
| commit | 46439007cf417cbd9ac8049bb4122c890097a0fa (patch) | |
| tree | 6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /man/2/env | |
| parent | 37da2899f40661e3e9631e497da8dc59b971cbd0 (diff) | |
20060303-partial
Diffstat (limited to 'man/2/env')
| -rw-r--r-- | man/2/env | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/man/2/env b/man/2/env new file mode 100644 index 00000000..185bd332 --- /dev/null +++ b/man/2/env @@ -0,0 +1,52 @@ +.TH ENV 2 +.SH NAME +env \- environment module +.SH SYNOPSIS +.EX +include "env.m"; +env = load Env Env->PATH; + +getenv: fn(var: string): string; +setenv: fn(var: string, val: string): int; +getall: fn(): list of (string, string); +clone: fn(): int; +new: fn(): int; +.EE +.SH DESCRIPTION +.B Env +provides an interface to manipulate environment variables which may then be shared +between processes. +.B Getenv +returns the value of the environment variable +.I var +passed as a parameter, +or +.B nil +if the variable is not set. It does +this by reading the contents of +.BI /env/ var. +.B Setenv +sets the value of the environment variable +.I var +to +.I val. +The value may be nil to unset the variable. It does this by writing the string +.I val +to +.BI /env/ var. +The routine returns a negative number if it fails to set the variable for any reason. +.B Getall +returns all the variables in the current environment as a list of (variable, value) pairs. +.B Clone +copies the current environment and places the process in a new environment group. Changes now +made to the environment will not affect the environment of other processes. +.B New +places the process in a new empty environment group. Changes made in this new environment will +not affect other processes. +.SH SOURCE +.B /appl/lib/env.b +.SH SEE ALSO +.IR env (1), +.IR sys-pctl (2), +.IR env (3) + |
