189b92712SRobert Mustacchi.\" 289b92712SRobert Mustacchi.\" This file and its contents are supplied under the terms of the 389b92712SRobert Mustacchi.\" Common Development and Distribution License ("CDDL"), version 1.0. 489b92712SRobert Mustacchi.\" You may only use this file in accordance with the terms of version 589b92712SRobert Mustacchi.\" 1.0 of the CDDL. 689b92712SRobert Mustacchi.\" 789b92712SRobert Mustacchi.\" A full copy of the text of the CDDL should have accompanied this 889b92712SRobert Mustacchi.\" source. A copy of the CDDL is also available via the Internet at 989b92712SRobert Mustacchi.\" http://www.illumos.org/license/CDDL. 1089b92712SRobert Mustacchi.\" 1189b92712SRobert Mustacchi.\" 1289b92712SRobert Mustacchi.\" Copyright (c) 2014, Joyent, Inc. 1389b92712SRobert Mustacchi.\" 1489b92712SRobert Mustacchi.Dd "Dec 20, 2014" 1589b92712SRobert Mustacchi.Dt CLEARENV 3C 1689b92712SRobert Mustacchi.Os 1789b92712SRobert Mustacchi.Sh NAME 1889b92712SRobert Mustacchi.Nm clearenv 1989b92712SRobert Mustacchi.Nd clear environment 2089b92712SRobert Mustacchi.Sh SYNOPSIS 2189b92712SRobert Mustacchi.In stdlib.h 2289b92712SRobert Mustacchi.Ft int 2389b92712SRobert Mustacchi.Fo clearenv 2489b92712SRobert Mustacchi.Fa void 2589b92712SRobert Mustacchi.Fc 2689b92712SRobert Mustacchi.Sh DESCRIPTION 2789b92712SRobert MustacchiThe 2889b92712SRobert Mustacchi.Fn clearenv 2972d3dbb9SYuri Pankovfunction clears the contents of the environment. 3072d3dbb9SYuri PankovAll environment variables in the calling process are removed as though the 3172d3dbb9SYuri Pankovfunction 3289b92712SRobert Mustacchi.Xr unsetenv 3C 3372d3dbb9SYuri Pankovhad been called on every environment variable. 3472d3dbb9SYuri PankovUntil subsequent calls to 3589b92712SRobert Mustacchi.Xr putenv 3C 3689b92712SRobert Mustacchior 3789b92712SRobert Mustacchi.Xr setenv 3C 3889b92712SRobert Mustacchiare made, calls to 3989b92712SRobert Mustacchi.Xr getenv 3C 4089b92712SRobert Mustacchiwill always return 4189b92712SRobert Mustacchi.Sy NULL . 4289b92712SRobert Mustacchi.Sh RETURN VALUES 4389b92712SRobert MustacchiUpon successful completion, 4489b92712SRobert Mustacchi.Fn clearenv 4589b92712SRobert Mustacchireturns 4689b92712SRobert Mustacchi.Sy 0 . 4789b92712SRobert MustacchiOtherwise, it returns a non-zero value and sets 4889b92712SRobert Mustacchi.Sy errno 4972d3dbb9SYuri Pankovto indicate the error. 5072d3dbb9SYuri PankovAt this time, no errors are defined for 5189b92712SRobert Mustacchi.Fn clearenv , 5272d3dbb9SYuri Pankovit will always succeed. 5372d3dbb9SYuri PankovPortable applications should always check the return value of 5489b92712SRobert Mustacchi.Fn clearenv . 5589b92712SRobert Mustacchi.Sh ERRORS 5689b92712SRobert MustacchiNo errors are defined. 5789b92712SRobert Mustacchi.Sh INTERFACE STABILITY 5889b92712SRobert Mustacchi.Sy Committed . 5989b92712SRobert Mustacchi.Sh MT-LEVEL 6089b92712SRobert Mustacchi.Sy Mt-Safe . 6189b92712SRobert Mustacchi.Sh SEE ALSO 6289b92712SRobert Mustacchi.Xr getenv 3C , 6389b92712SRobert Mustacchi.Xr setenv 3C , 643a005aadSYuri Pankov.Xr unsetenv 3C , 65*bbf21555SRichard Lowe.Xr attributes 7 , 66*bbf21555SRichard Lowe.Xr environ 7 , 67*bbf21555SRichard Lowe.Xr standards 7 68