Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c/./putenv.3c
Real path: /usr/share/man/man3c/putenv.3c
Zurück
'\" te .\" Copyright (c) 1989, AT&T. All rights reserved. .\" Copyright (c) 1987, 2022, Oracle and/or its affiliates. .\" Portions Copyright (c) 1992, The X/Open Company Ltd. All rights reserved. .\" Oracle gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. .TH putenv 3C "4 Aug 2022" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME putenv \- change or add value to environment .SH SYNOPSIS .LP .nf #include <stdlib.h> \fBint\fR \fBputenv\fR(\fBchar *\fR\fIstring\fR); .fi .SH DESCRIPTION .sp .LP The \fBputenv()\fR function makes the value of the environment variable \fIname\fR equal to \fIvalue\fR by altering an existing variable or creating a new one. In either case, the string pointed to by \fIstring\fR becomes part of the environment, so altering the string will change the environment. .sp .LP The \fIstring\fR argument points to a string of the form \fIname\fR\fB=\fR\fIvalue\fR. The space used by \fIstring\fR is no longer used once a new string-defining \fIname\fR is passed to \fBputenv()\fR. .sp .LP If the \fIstring\fR argument points to a string without an '\fB=\fR' character, then the equivalent of \fBunsetenv\fR(3C) is performed. .sp .LP The \fBputenv()\fR function may use \fBmalloc\fR(3C) to enlarge the environment. .sp .LP After \fBputenv()\fR is called, environment variables are not in alphabetical order. .SH RETURN VALUES .sp .LP Upon successful completion, \fBputenv()\fR returns 0. Otherwise, it returns a non-zero value and sets \fBerrno\fR to indicate the error. .SH ERRORS .sp .LP The \fBputenv()\fR function may fail if: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The \fIstring\fR argument is not of the form "\fIname\fR=\fIvalue\fR", or "\fIname\fR", as described above. .RE .sp .ne 2 .mk .na \fB\fBENOMEM\fR\fR .ad .RS 10n .rt Insufficient memory was available. .RE .SH USAGE .sp .LP The \fBputenv()\fR function can be safely called from multithreaded programs. Caution must be exercised when using this function and \fBgetenv\fR(3C) in multithreaded programs. These functions examine and modify the environment list, which is shared by all threads in a program. 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 \fBputenv()\fR or \fBgetenv()\fR. .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 Safe _ Standard See \fBstandards\fR(7). .TE .sp .SH SEE ALSO .sp .LP \fBexec\fR(2), \fBgetenv\fR(3C), \fBmalloc\fR(3C), \fBsetenv\fR(3C), \fBunsetenv\fR(3C), \fBattributes\fR(7), \fBenviron\fR(7), \fBstandards\fR(7) .SH WARNINGS .sp .LP The \fIstring\fR argument should not be an automatic variable. It should be declared static if it is declared within a function because it cannot be automatically declared. A potential error is to call \fBputenv()\fR with a pointer to an automatic variable as the argument and to then exit the calling function while \fIstring\fR is still part of the environment. .SH HISTORY .sp .LP Support for \fIstring\fR arguments without an '\fB=\fR' character to unset a variable was added in Oracle Solaris 11.4.27. .sp .LP The \fBputenv()\fR function has been included in all Sun and Oracle releases of Solaris.