.\" Copyright 2001 John Levon .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" Additions, aeb, 2001-10-17. .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2001-2002 Yuichi SATO .\" all rights reserved. .\" Translated Sun Nov 4 22:46:03 JST 2001 .\" by Yuichi SATO .\" Updated & Modifined Mon Jul 15 02:10:29 JST 2002 by Yuichi SATO .\" .TH CLEARENV 3 2017\-09\-15 Linux "Linux Programmer's Manual" .SH 名前 clearenv \- 環境 (environment) をクリアする .SH 書式 .nf \fB#include \fP .PP \fBint clearenv(void);\fP .fi .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP \fBclearenv\fP(): /* Glibc since 2.19: */ _DEFAULT_SOURCE || /* Glibc versions <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE .SH 説明 The \fBclearenv\fP() function clears the environment of all name\-value pairs and sets the value of the external variable \fIenviron\fP to NULL. After this call, new variables can be added to the environment using \fBputenv\fP(3) and \fBsetenv\fP(3). .SH 返り値 .\" Most versions of UNIX return -1 on error, or do not even have errors. .\" Glibc info and the Watcom C library document "a nonzero value". \fBclearenv\fP() 関数は、成功した場合は 0 を返し、 失敗した場合は 0 以外を返す。 .SH バージョン glibc 2.0 以降で利用可能。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lb lb lb l l l. インターフェース 属性 値 T{ \fBclearenv\fP() T} Thread safety MT\-Unsafe const:env .TE .sp 1 .SH 準拠 (DG/UX, HP\-UX, QNX, などの) 多くの UNIX 系 OS。 (FORTRAN77 へのバインディングである) POSIX.9。 POSIX.1\-1996 では \fBclearenv\fP() と \fBputenv\fP(3) は採用されなかったが、 方針が変更され、この標準規格の以降の号 (\[sc] B.4.6.1 を参照) では 採用されることになった。 しかし POSIX.1\-2001 では \fBputenv\fP(3) だけが追加され、 \fBclearenv\fP() の追加は否決された。 .SH 注意 On systems where \fBclearenv\fP() is unavailable, the assignment .PP .in +4n .EX environ = NULL; .EE .in .PP というように変数 environ を設定すればよい。 .PP The \fBclearenv\fP() function may be useful in security\-conscious applications that want to precisely control the environment that is passed to programs executed using \fBexec\fP(3). The application would do this by first clearing the environment and then adding select environment variables. .PP Note that the main effect of \fBclearenv\fP() is to adjust the value of the pointer \fBenviron\fP(7); this function does not erase the contents of the buffers containing the environment definitions. .PP .\" .LP .\" HP-UX has a ENOMEM error return. DG/UX と Tru64 man ページには次のように記されている: \fIenviron\fP が \fBputenv\fP(3), \fBgetenv\fP(3), \fBclearenv\fP() 関数以外で変更された場合、 \fBclearenv\fP() はエラーを返し、プロセス環境は変更前のままにされる。 .SH 関連項目 \fBgetenv\fP(3), \fBputenv\fP(3), \fBsetenv\fP(3), \fBunsetenv\fP(3), \fBenviron\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。