Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (2) — Plan9 1st Edition

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

env(3)

GETENV(2)

NAME

getenv, putenv − access environment variables

SYNOPSIS

char∗getenv(char ∗name)
intputenv(char ∗name, char ∗val)

DESCRIPTION

­Getenv reads the contents of /env/name (see env(3)) into memory allocated with malloc(2), 0-terminates it, and returns a pointer to that area. If no file exists, 0 is returned.

­Putenv creates the file /env/name and writes the string ­val to it.  The terminating ­0 is not written.  If the file value cannot be written, −1 is returned. 

SEE ALSO

env(3)

DIAGNOSTICS

Sets ­errstr. 

Plan 9  —  January 03, 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026