setenv(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

setenv(3c)

setenv(3C)               Standard C Library Functions               setenv(3C)

NAME
       setenv - add or change environment variable

SYNOPSIS
       #include <stdlib.h>

       int setenv(const char *envname, const char *envval,
            int overwrite);

DESCRIPTION
       The  setenv() function updates or adds a variable in the environment of
       the calling process. The envname argument points to a string containing
       the name of an environment variable to be added or altered.  The  envi‐
       ronment  variable is set to the value to which envval points. The func‐
       tion fails if envname points to a string which contains an '='  charac‐
       ter.  If  the  environment variable named by envname already exists and
       the value of overwrite is non-zero, the function  returns  successfully
       and  the  environment  is updated. If the environment variable named by
       envname already exists and the value of overwrite is zero, the function
       returns successfully and the environment remains unchanged.


       If the application modifies environ or the pointers to which it points,
       the behavior of setenv() is undefined. The  setenv()  function  updates
       the list of pointers to which environ points.


       The  strings  described  by envname and envval are copied by this func‐
       tion.

RETURN VALUES
       Upon successful completion, 0 is returned. Otherwise, -1  is  returned,
       errno set to indicate the error, and the environment is left unchanged.

ERRORS
       The setenv() function will fail if:

       EINVAL    The  envname  argument  is a null pointer, points to an empty
                 string, or points to a string containing an '=' character.


       ENOMEM    Insufficient memory was available to add a  variable  or  its
                 value to the environment.


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe _  Stan‐
       dardSee standards(7).


SEE ALSO
       getenv(3C), unsetenv(3C), attributes(7), standards(7)

Oracle Solaris 11.4               31 Mar 2002                       setenv(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3