'\" te .\" Copyright 1989 AT&T Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved .TH getenv 3C "24 Jul 2002" "SunOS 5.11" "Standard C Library Functions" .SH NAME getenv \- return value for environment name .SH SYNOPSIS .LP .nf #include \fBchar *\fR\fBgetenv\fR(\fBconst char *\fR\fIname\fR); .fi .SH DESCRIPTION .sp .LP The \fBgetenv()\fR function searches the environment list (see \fBenviron\fR(5)) for a string of the form \fIname\fR\fB=\fR\fIvalue\fR and, if the string is present, returns a pointer to the \fIvalue\fR in the current environment. .SH RETURN VALUES .sp .LP If successful, \fBgetenv()\fR returns a pointer to the \fIvalue\fR in the current environment; otherwise, it returns a null pointer. .SH USAGE .sp .LP The \fBgetenv()\fR function can be safely called from a multithreaded application. Care must be exercised when using both \fBgetenv()\fR and \fBputenv\fR(3C) in a multithreaded application. These functions examine and modify the environment list, which is shared by all threads in an application. The system prevents the list from being accessed simultaneously by two different threads. It does not, however, prevent two threads from successively accessing the environment list using \fBgetenv()\fR or \fBputenv\fR(3C). .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelSafe _ StandardSee \fBstandards\fR(5). .TE .SH SEE ALSO .sp .LP \fBexec\fR(2), \fBputenv\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)