Files
oldlinux-files/Ref-docs/POSIX/susv3/functions/unsetenv.html
2024-02-19 00:21:47 -05:00

129 lines
4.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
<title>unsetenv</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="unsetenv"></a> <a name="tag_03_804"></a><!-- unsetenv -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_03_804_01"></a>NAME</h4>
<blockquote>unsetenv - remove an environment variable</blockquote>
<h4><a name="tag_03_804_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<div class="box"><code><tt><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt=
"[Option Start]" border="0"> #include &lt;<a href="../basedefs/stdlib.h.html">stdlib.h</a>&gt;<br>
<br>
int unsetenv(const char *</tt><i>name</i><tt>); <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div>
<tt><br>
</tt></blockquote>
<h4><a name="tag_03_804_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>unsetenv</i>() function shall remove an environment variable from the environment of the calling process. The <i>name</i>
argument points to a string, which is the name of the variable to be removed. The named argument shall not contain an <tt>'='</tt>
character. If the named variable does not exist in the current environment, the environment shall be unchanged and the function is
considered to have completed successfully.</p>
<p>If the application modifies <i>environ</i> or the pointers to which it points, the behavior of <i>unsetenv</i>() is undefined.
The <i>unsetenv</i>() function shall update the list of pointers to which <i>environ</i> points.</p>
<p>The <i>unsetenv</i>() function need not be reentrant. A function that is not required to be reentrant is not required to be
thread-safe.</p>
</blockquote>
<h4><a name="tag_03_804_04"></a>RETURN VALUE</h4>
<blockquote>
<p>Upon successful completion, zero shall be returned. Otherwise, -1 shall be returned, <i>errno</i> set to indicate the error, and
the environment shall be unchanged.</p>
</blockquote>
<h4><a name="tag_03_804_05"></a>ERRORS</h4>
<blockquote>
<p>The <i>unsetenv</i>() function shall fail if:</p>
<dl compact>
<dt>[EINVAL]</dt>
<dd>The <i>name</i> argument is a null pointer, points to an empty string, or points to a string containing an <tt>'='</tt>
character.</dd>
</dl>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_03_804_06"></a>EXAMPLES</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_804_07"></a>APPLICATION USAGE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_804_08"></a>RATIONALE</h4>
<blockquote>
<p>Refer to the RATIONALE section in <a href="setenv.html"><i>setenv</i>()</a> .</p>
</blockquote>
<h4><a name="tag_03_804_09"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_804_10"></a>SEE ALSO</h4>
<blockquote>
<p><a href="getenv.html"><i>getenv</i>()</a> , <a href="setenv.html"><i>setenv</i>()</a> , the Base Definitions volume of
IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/stdlib.h.html"><i>&lt;stdlib.h&gt;</i></a>, <a href=
"../basedefs/sys/types.h.html"><i>&lt;sys/types.h&gt;</i></a>, <a href="../basedefs/unistd.h.html"><i>&lt;unistd.h&gt;</i></a></p>
</blockquote>
<h4><a name="tag_03_804_11"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 6. Derived from the IEEE&nbsp;P1003.1a draft standard.</p>
</blockquote>
<div class="box"><em>End of informative text.</em></div>
<hr>
<hr size="2" noshade>
<center><font size="2"><!--footer start-->
UNIX &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; is a registered Trademark of The IEEE.<br>
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
]</font></center>
<!--footer end-->
<hr size="2" noshade>
</body>
</html>