xref: /illumos-gate/usr/src/man/man3c/clearenv.3c (revision 66582b606a8194f7f3ba5b3a3a6dca5b0d346361)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright (c) 2014, Joyent, Inc.
13.\"
14.Dd "Dec 20, 2014"
15.Dt CLEARENV 3C
16.Os
17.Sh NAME
18.Nm clearenv
19.Nd clear environment
20.Sh SYNOPSIS
21.In stdlib.h
22.Ft int
23.Fo clearenv
24.Fa void
25.Fc
26.Sh DESCRIPTION
27The
28.Fn clearenv
29function clears the contents of the environment.
30All environment variables in the calling process are removed as though the
31function
32.Xr unsetenv 3C
33had been called on every environment variable.
34Until subsequent calls to
35.Xr putenv 3C
36or
37.Xr setenv 3C
38are made, calls to
39.Xr getenv 3C
40will always return
41.Sy NULL .
42.Sh RETURN VALUES
43Upon successful completion,
44.Fn clearenv
45returns
46.Sy 0 .
47Otherwise, it returns a non-zero value and sets
48.Sy errno
49to indicate the error.
50At this time, no errors are defined for
51.Fn clearenv ,
52it will always succeed.
53Portable applications should always check the return value of
54.Fn clearenv .
55.Sh ERRORS
56No errors are defined.
57.Sh INTERFACE STABILITY
58.Sy Committed .
59.Sh MT-LEVEL
60.Sy Mt-Safe .
61.Sh SEE ALSO
62.Xr getenv 3C ,
63.Xr setenv 3C ,
64.Xr unsetenv 3C ,
65.Xr attributes 5 ,
66.Xr environ 5 ,
67.Xr standards 5
68