OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / release / man3 / setenv.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\" and Copyright (C) 2004, 2007 Michael kerrisk <mtk.manpages@gmail.com>
3 .\"
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.
7 .\"
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.
12 .\"
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
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
24 .\" References consulted:
25 .\"     Linux libc source code
26 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\"     386BSD man pages
28 .\" Modified Sat Jul 24 18:20:58 1993 by Rik Faith (faith@cs.unc.edu)
29 .\" Modified Fri Feb 14 21:47:50 1997 by Andries Brouwer (aeb@cwi.nl)
30 .\" Modified 9 Jun 2004, Michael Kerrisk <mtk.manpages@gmail.com>
31 .\"     Changed unsetenv() prototype; added EINVAL error
32 .\"     Noted nonstandard behavior of setenv() if name contains '='
33 .\" 2005-08-12, mtk, glibc 2.3.4 fixed the "name contains '='" bug
34 .\"
35 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
36 .\"     all rights reserved.
37 .\" Translated 1997-12-19, HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
38 .\" Updated & Modified 2005-02-17, Yuichi SATO <ysato444@yahoo.co.jp>
39 .\" Updated & Modified 2005-10-02, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
40 .\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05
41 .\" Updated 2010-04-10, Akihiro MOTOKI, LDP v3.24
42 .\"
43 .TH SETENV 3  2009-09-20 "GNU" "Linux Programmer's Manual"
44 .SH Ì¾Á°
45 setenv \- ´Ä¶­ÊÑ¿ô¤òÊѹ¹¤Þ¤¿¤ÏÄɲ乤ë
46 .SH ½ñ¼°
47 .nf
48 .B #include <stdlib.h>
49 .sp
50 .BI "int setenv(const char *" name ", const char *" value ", int " overwrite );
51 .sp
52 .BI "int unsetenv(const char *" name );
53 .fi
54 .sp
55 .in -4n
56 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
57 .RB ( feature_test_macros (7)
58 »²¾È):
59 .in
60 .sp
61 .ad l
62 .BR setenv (),
63 .BR unsetenv ():
64 _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600
65 .ad b
66 .SH ÀâÌÀ
67 .BR setenv ()
68 ´Ø¿ô¤Ï¡¢\fIname\fP ¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç
69 ´Ä¶­ÊÑ¿ô \fIname\fP ¤ËÃÍ \fIvalue\fP ¤òÀßÄꤷ¡¢´Ä¶­¤ËÄɲ乤롣
70 \fIname\fP ¤¬´Ä¶­¤Ë¸ºß¤¹¤ë¾ì¹ç¡¢\fIoverwrite\fP ¤¬ 0 °Ê³°¤Ê¤é¤Ð
71 ¤½¤ÎÃͤò \fIvalue\fP ¤ËÊѹ¹¤·¡¢\fIoverwrite\fP ¤¬ 0 ¤Ê¤é¤Ð
72 \fIname\fP ¤ÎÃͤòÊѹ¹¤·¤Ê¤¤¡£
73 ¤³¤Î´Ø¿ô¤Ï¡¢
74 .RB ( putenv (3)
75 ¤È°ã¤¤)
76 .I name
77 ¤È
78 .I value
79 ¤Ë¤è¤ê»²¾È¤µ¤ì¤ëʸ»úÎó¤Î¥³¥Ô¡¼¤ò¹Ô¤¦¡£
80 .PP
81 .BR unsetenv ()
82 ´Ø¿ô¤Ï¡¢ÊÑ¿ô \fIname\fP ¤ò´Ä¶­¤«¤éºï½ü¤¹¤ë¡£
83 .I name
84 ¤¬´Ä¶­¤Ë¤Ê¤¤¾ì¹ç¡¢¤³¤Î´Ø¿ô¤ÏÀ®¸ù¤·¡¢´Ä¶­¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
85 .SH ÊÖ¤êÃÍ
86 .BR setenv ()
87 ´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£
88 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
89 .I errno
90 ¤Ë¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£
91
92 .BR unsetenv ()
93 ´Ø¿ô¤Ï¡¢À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£
94 ¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢
95 .I errno
96 ¤òÀßÄꤷ¤Æ¥¨¥é¡¼¤Î¸¶°ø¤ò¼¨¤¹¡£
97 .SH ¥¨¥é¡¼
98 .TP
99 .B EINVAL
100 .I name
101 ¤¬ NULL ¤Ç¤¢¤ë¤«¡¢Ä¹¤µ¤¬ 0 ¤Îʸ»úÎó¤ò»Ø¤·¤Æ¤¤¤ë¤«¡¢
102 \(aq=\(aq Ê¸»ú¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£
103 .TP
104 .B ENOMEM
105 ´Ä¶­¤Ë¿·¤·¤¤ÊÑ¿ô¤òÄɲ乤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£
106 .SH ½àµò
107 4.3BSD, POSIX.1-2001.
108 .SH Ãí°Õ
109 POSIX.1-2001 ¤Ï¡¢
110 .BR setenv ()
111 ¤ä
112 .BR unsetenv ()
113 ¤¬¥ê¥¨¥ó¥È¥é¥ó¥È (ºÆÆþ²Äǽ) ¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤Ê¤¤¡£
114
115 glibc 2.2.2 °ÊÁ°¤Ç¤Ï¡¢
116 .BR unsetenv ()
117 ¤Ï
118 ÊÖ¤êÃͤ¬ \fIvoid\fP ¤Î¥×¥í¥È¥¿¥¤¥×¤Ç¤¢¤Ã¤¿¡£
119 ¤â¤Ã¤ÈºÇ¶á¤Î glibc ÈǤϡ¢¡Ö½ñ¼°¡×¥»¥¯¥·¥ç¥ó¤Ç¼¨¤·¤Æ¤¤¤ë¤è¤¦¤Ë
120 POSIX.1-2001 ¸ß´¹¤Î¥×¥í¥È¥¿¥¤¥×¤Ç¤¢¤ë¡£
121 .SH ¥Ð¥°
122 POSIX.1-2001 ¤Ç¤Ï
123 .RI ¡Ö name
124 ¤Ë \(aq=\(aq Ê¸»ú¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¡¢
125 .BR setenv ()
126 ¤Ï¥¨¥é¡¼
127 .B EINVAL
128 ¤Ç¼ºÇÔ¤¹¤Ù¤­¤Ç¤¢¤ë¡×¤È½Ò¤Ù¤é¤ì¤Æ¤¤¤ë¡£
129 ¤·¤«¤· 2.3.4 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î glibc ¤Ç¤Ï¡¢
130 .I name
131 ¤Ë \(aq=\(aq Ê¸»ú¤¬´Þ¤Þ¤ì¤ë¤Î¤òµö¤·¤Æ¤¤¤ë¡£
132 .SH ´ØÏ¢¹àÌÜ
133 .BR clearenv (3),
134 .BR getenv (3),
135 .BR putenv (3),
136 .BR environ (7)