mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
42 lines
687 B
Groff
42 lines
687 B
Groff
.TH GETENV 3
|
|
.SH NAME
|
|
getenv, putenv \- access environment variables
|
|
.SH SYNOPSIS
|
|
.B #include <u.h>
|
|
.br
|
|
.B #include <libc.h>
|
|
.PP
|
|
.nf
|
|
.B
|
|
char* getenv(char *name)
|
|
.br
|
|
.B
|
|
int putenv(char *name, char *val)
|
|
.fi
|
|
.SH DESCRIPTION
|
|
.I Getenv
|
|
fetches the environment value associated with
|
|
.I name
|
|
into memory allocated with
|
|
.IR malloc (3),
|
|
0-terminates it,
|
|
and returns a pointer to that area.
|
|
If no file exists, 0
|
|
is returned.
|
|
.PP
|
|
.I Putenv
|
|
sets the environment value associated with
|
|
.I name
|
|
to
|
|
.IR val .
|
|
.SH SOURCE
|
|
.B /usr/local/plan9/src/lib9/getenv.c
|
|
.SH DIAGNOSTICS
|
|
Sets
|
|
.IR errstr .
|
|
.SH BUGS
|
|
Defined as macros for
|
|
.I p9getenv
|
|
and
|
|
.I p9putenv
|
|
to avoid name conflicts with Unix library calls.
|