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 27 The 28 .Fn clearenv 29 function clears the contents of the environment. All environment variables in 30 the calling process are removed as though the function 31 .Xr unsetenv 3C 32 had been called on every environment variable. Until subsequent calls to 33 .Xr putenv 3C 34 or 35 .Xr setenv 3C 36 are made, calls to 37 .Xr getenv 3C 38 will always return 39 .Sy NULL . 40 .Sh RETURN VALUES 41 Upon successful completion, 42 .Fn clearenv 43 returns 44 .Sy 0 . 45 Otherwise, it returns a non-zero value and sets 46 .Sy errno 47 to indicate the error. At this time, no errors are defined for 48 .Fn clearenv , 49 it will always succeed. Portable applications should always check the return 50 value of 51 .Fn clearenv . 52 .Sh ERRORS 53 No errors are defined. 54 .Sh INTERFACE STABILITY 55 .Sy Committed . 56 .Sh MT-LEVEL 57 .Sy Mt-Safe . 58 .Sh SEE ALSO 59 .Xr getenv 3C , 60 .Xr unsetenv 3C , 61 .Xr setenv 3C , 62 .Xr attributes 5 , 63 .Xr environ 5 , 64 .Xr standards 5 65