PGETENV(3PROC) Process Control Library Functions PGETENV(3PROC)

Pgetenv
get process environment variable

Process Control Library (libproc, -lproc)

#include <libproc.h>
char *
Pgetenv(struct ps_prochandle *P, const char *name, char *buf, size_t buflen);

The Pgetenv function searches the environment of the process handle P for the environment variable named name. If found it copies up to buflen characters of the value, including the null terminator, into the buffer buf. Everything after the = sign is copied.

Upon successful completion, the Pgetenv() function returns the pointer buf. Otherwise, if the environment variable was not found, NULL is returned.

Uncommitted

See LOCKING in libproc(3LIB).

libproc(3LIB), Penv_iter(3PROC), environ(5)
May 11, 2016 illumos