Blob
1 .TH GETENV 32 .SH NAME3 getenv, putenv \- access environment variables4 .SH SYNOPSIS5 .B #include <u.h>6 .br7 .B #include <libc.h>8 .PP9 .nf10 .B11 char* getenv(char *name)12 .br13 .B14 int putenv(char *name, char *val)15 .fi16 .SH DESCRIPTION17 .I Getenv18 reads the contents of19 .BI /env/ name20 (see21 .IR env (3))22 into memory allocated with23 .IR malloc (3),24 0-terminates it,25 and returns a pointer to that area.26 If no file exists, 027 is returned.28 .PP29 .I Putenv30 creates the file31 .BI /env/ name32 and writes the string33 .I val34 to it. The terminating35 .B 036 is not written.37 If the file value cannot be written, \-1 is returned.38 .SH SOURCE39 .B /usr/local/plan9/src/libc/9sys40 .SH SEE ALSO41 .IR env (3)42 .SH DIAGNOSTICS43 Sets44 .IR errstr .