1 .\" Copyright 2001 John Levon <moz@compsoc.man.ac.uk>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Additions, aeb, 2001-10-17.
26 .TH CLEARENV 3 2014-08-19 "Linux" "Linux Programmer's Manual"
28 clearenv \- clear the environment
31 .B #include <stdlib.h>
33 .B "int clearenv(void);"
37 Feature Test Macro Requirements for glibc (see
38 .BR feature_test_macros (7)):
42 _SVID_SOURCE || _BSD_SOURCE
46 function clears the environment of all name-value
47 pairs and sets the value of the external variable
53 function returns zero on success, and a nonzero
55 .\" Most versions of UNIX return -1 on error, or do not even have errors.
56 .\" Glibc info and the Watcom C library document "a nonzero value".
58 Available since glibc 2.0.
60 For an explanation of the terms used in this section, see
66 Interface Attribute Value
69 T} Thread safety MT-Unsafe const:env
73 Various UNIX variants (DG/UX, HP-UX, QNX, ...).
74 POSIX.9 (bindings for FORTRAN77).
75 POSIX.1-1996 did not accept
79 but changed its mind and scheduled these functions for some
80 later issue of this standard (cf. B.4.6.1).
87 Used in security-conscious applications.
97 The DG/UX and Tru64 man pages write: If
99 has been modified by anything other than the
106 will return an error and the process environment will remain unchanged.
108 .\" HP-UX has a ENOMEM error return.