Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c/./getenv.3c
Real path: /usr/share/man/man3c/getenv.3c
Zurück
'\" te .\" Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. .\" Copyright (c) 1989, 2002, AT&T. All rights reserved. .TH getenv 3C "9 Jul 2018" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME getenv, secure_getenv, getenv_s \- return value for environment name .SH SYNOPSIS .LP .nf #include <stdlib.h> \fBchar *\fR\fBgetenv\fR(\fBconst char *\fR\fIname\fR); \fBchar *\fR\fBsecure_getenv\fR(\fBconst char *\fR\fIname\fR); .fi .LP .nf #define __STDC_WANT_LIB_EXT1__ 1 #include <stdlib.h> \fBerrno_t\fR \fBgetenv_s\fR(\fBsize_t *restrict\fR \fIlen\fR, \fBchar *restrict\fR \fIvalue\fR, \fBsize_t\fR \fImaxsize\fR, \fBconst char *restrict\fR \fIname\fR); .fi .SH DESCRIPTION .sp .LP The \fBgetenv()\fR function searches the environment list (see \fBenviron\fR(7)) 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. .sp .LP The \fBsecure_getenv()\fR function behaves like \fBgetenv()\fR except that it returns a null pointer if the \fBissetugid()\fR calls returns a non-zero value. For more information, see the \fBissetugid\fR(2) man page. .sp .LP The \fBgetenv_s()\fR function is part of the bounds checking interfaces specified in the C11 standard, Annex K. It behaves in a manner similar to the \fBgetenv()\fR function, but with differing parameters and return type in order to provide additional safety checks in the form of explicit runtime-constraints as defined in the C11 standard. See \fBruntime_constraint_handler\fR(3C) and INCITS/ISO/IEC 9899:2011. .SH RETURN VALUES .sp .LP If successful, \fBgetenv()\fR and \fBsecure_getenv()\fR return a pointer to the \fIvalue\fR in the current environment; otherwise, they return a null pointer. .sp .LP If the specified \fIname\fR is found and the associated string was successfully stored in \fIvalue\fR, the \fBgetenv_s()\fR function returns zero; otherwise, it returns a non-zero value. .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt Null pointer is passed .RE .sp .ne 2 .mk .na \fB\fBERANGE\fR\fR .ad .RS 10n .rt \fBsize\fR argument is not a valid value .RE .sp .ne 2 .mk .na \fB\fBENOENT\fR\fR .ad .RS 10n .rt No such file or directory .RE .SH USAGE .sp .LP The \fBgetenv()\fR and \fBsecure_getenv()\fR functions can be safely called from a multithreaded application. Care must be exercised when using either \fBgetenv()\fR or \fBsecure_getenv()\fR functions with \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, \fBsecure_getenv()\fR, or \fBputenv\fR(3C). .sp .LP The \fBsecure_getenv()\fR function is intended for use in general-purpose libraries to avoid vulnerabilities that could occur if programs with raised privilege accidentally trusted the environment. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ MT-Level See below _ Standard See below .TE .sp .sp .LP The \fBgetenv()\fR and \fBsecure_getenv()\fR functions can be used safely in multithreaded applications, with the caveats noted above. .sp .LP The \fBgetenv_s()\fR function cannot be used safely in a multithreaded application due to the runtime constraint handler. For more information, see the \fBruntime_constraint_handler\fR(3C) man page. .sp .LP The \fBgetenv()\fR function is specified by the ISO C and XPG standards. The \fBgetenv_s()\fR function is specified by the ISO C11 standard. The \fBsecure_getenv()\fR function is not specified by any current standards. See \fBstandards\fR(7) for further details. .SH SEE ALSO .sp .LP \fBexec\fR(2), \fBissetugid\fR(2), \fBputenv\fR(3C), \fBattributes\fR(7), \fBenviron\fR(7), \fBstandards\fR(7), \fBruntime_constraint_handler\fR(3C) .SH HISTORY .sp .LP The \fBgetenv_s()\fR function was added to Oracle Solaris in the 11.4 release. .sp .LP The \fBsecure_getenv()\fR function was added to Oracle Solaris in the 11.3 SRU 10 release.