1 .\" Copyright 2001 John Levon <moz@compsoc.man.ac.uk>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Additions, aeb, 2001-10-17.
25 .\" Japanese Version Copyright (c) 2001-2002 Yuichi SATO
26 .\" all rights reserved.
27 .\" Translated Sun Nov 4 22:46:03 JST 2001
28 .\" by Yuichi SATO <ysato@h4.dion.ne.jp>
29 .\" Updated & Modifined Mon Jul 15 02:10:29 JST 2002 by Yuichi SATO
31 .TH CLEARENV 3 2007-07-26 "Linux" "Linux Programmer's Manual"
34 .\"O clearenv \- clear the environment
35 clearenv \- ´Ä¶ (environment) ¤ò¥¯¥ê¥¢¤¹¤ë
39 .B #include <stdlib.h>
41 .B "int clearenv(void);"
45 .\"O Feature Test Macro Requirements for glibc (see
46 .\"O .BR feature_test_macros (7)):
47 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
48 .RB ( feature_test_macros (7)
53 _SVID_SOURCE || _XOPEN_SOURCE
58 .\"O function clears the environment of all name-value
59 .\"O pairs and sets the value of the external variable
63 ´Ø¿ô¤Ï¡¢Ì¾Á°¤ÈÃͤ¬ÁȤˤʤä¿Á´¤Æ¤Î´Ä¶¤ò¥¯¥ê¥¢¤¹¤ë¡£
67 .\"O .SH "RETURN VALUE"
71 .\"O function returns zero on success, and a nonzero
72 .\"O value on failure.
74 ´Ø¿ô¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤òÊÖ¤·¡¢
75 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï 0 °Ê³°¤òÊÖ¤¹¡£
76 .\"O .\" Most versions of Unix return -1 on error, or do not even have errors.
77 .\"O .\" Glibc info and the Watcom C library document "a nonzero value".
78 .\" Unix ·Ï OS ¤Î¿¤¯¤Ï¡¢¥¨¥é¡¼¤Î¾ì¹ç¤Ë \-1 ¤òÊÖ¤¹¡£
79 .\" ¤â¤·¤¯¤Ï¥¨¥é¡¼¤Î¾ì¹ç¤Ç¤â²¿¤âÊÖ¤µ¤Ê¤¤¡£
80 .\" glibc ¤Î info ¤È Watcom C ¥é¥¤¥Ö¥é¥ê¤Ë¤Ï¡¢
81 .\" ¡Ö0 °Ê³°¤ÎÃÍ (¤òÊÖ¤¹)¡×¤Èµ½Ò¤µ¤ì¤Æ¤¤¤ë¡£
84 .\"O Not in libc4, libc5.
85 .\"O In glibc since glibc 2.0.
86 libc4, libc5 ¤Ç¤Ï»ÈÍѤǤ¤Ê¤¤¡£
87 glibc 2.0 °Ê¹ß¤Î glibc ¤Ç»ÈÍѤǤ¤ë¡£
88 .\"O .SH "CONFORMING TO"
90 .\"O Various Unix variants (DG/UX, HP-UX, QNX, ...).
91 .\"O POSIX.9 (bindings for FORTRAN77).
92 .\"O POSIX.1-1996 did not accept
96 .\"O but changed its mind and scheduled these functions for some
97 .\"O later issue of this standard (cf. B.4.6.1).
98 .\"O However, POSIX.1-2001
99 .\"O only adds \fBputenv\fP(3), and rejected
100 .\"O .BR clearenv ().
101 (DG/UX, HP-UX, QNX, ¤Ê¤É¤Î) ¿¤¯¤Î Unix ·Ï OS¡£
102 (FORTRAN77 ¤Ø¤Î¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤Ç¤¢¤ë) POSIX.9¡£
107 ¤ÏºÎÍѤµ¤ì¤Ê¤«¤Ã¤¿¤¬¡¢
108 Êý¿Ë¤¬Êѹ¹¤µ¤ì¡¢¤³¤Îɸ½àµ¬³Ê¤Î°Ê¹ß¤Î¹æ (B.4.6.1 ¤ò»²¾È) ¤Ç¤Ï
109 ºÎÍѤµ¤ì¤ë¤³¤È¤Ë¤Ê¤Ã¤¿¡£
110 ¤·¤«¤· POSIX.1-2001 ¤Ç¤Ï
117 .\"O Used in security-conscious applications.
118 .\"O If it is unavailable
120 ¤³¤Î´Ø¿ô¤Ï¥»¥¥å¥ê¥Æ¥£¤Ë¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç»È¤ï¤ì¤ë¡£
121 ¤³¤Î´Ø¿ô¤¬»ÈÍѤǤ¤Ê¤¤¾ì¹ç¤Ï¡¢
127 .\"O will probably do.
128 ¤È¤¤¤¦¤è¤¦¤ËÊÑ¿ô environ ¤òÀßÄꤹ¤ì¤Ð¤è¤¤¡£
130 .\"O The DG/UX and Tru64 man pages write: If
132 .\"O has been modified by anything other than the
139 .\"O will return an error and the process environment will remain unchanged.
140 DG/UX ¤È Tru64 man ¥Ú¡¼¥¸¤Ë¤Ï¼¡¤Î¤è¤¦¤Ëµ¤µ¤ì¤Æ¤¤¤ë¡§
146 ´Ø¿ô°Ê³°¤ÇÊѹ¹¤µ¤ì¤¿¾ì¹ç¡¢
148 ¤Ï¥¨¥é¡¼¤òÊÖ¤·¡¢¥×¥í¥»¥¹´Ä¶¤ÏÊѹ¹Á°¤Î¤Þ¤Þ¤Ë¤µ¤ì¤ë¡£
150 .\"O .\" HP-UX has a ENOMEM error return.
151 .\" HP-UX ¤Ë¤Ï ENOMEM ¥¨¥é¡¼¤¬¤¢¤ë¡£