Blob


1 .TH GETENV 3
2 .SH NAME
3 getenv, putenv \- access environment variables
4 .SH SYNOPSIS
5 .B #include <u.h>
6 .br
7 .B #include <libc.h>
8 .PP
9 .nf
10 .B
11 char* getenv(char *name)
12 .br
13 .B
14 int putenv(char *name, char *val)
15 .fi
16 .SH DESCRIPTION
17 .I Getenv
18 fetches the environment value associated with
19 .I name
20 into memory allocated with
21 .IR malloc (3),
22 0-terminates it,
23 and returns a pointer to that area.
24 If no file exists, 0
25 is returned.
26 .PP
27 .I Putenv
28 sets the environment value associated with
29 .I name
30 to
31 .IR val .
32 .SH SOURCE
33 .B /usr/local/plan9/src/lib9/getenv.c
34 .SH DIAGNOSTICS
35 Sets
36 .IR errstr .
37 .SH BUGS
38 Defined as macros for
39 .I p9getenv
40 and
41 .I p9putenv
42 to avoid name conflicts with Unix library calls.