OSDN Git Service

(split) LDP v3.30, v3.31 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / getenv.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\" and Copyright (C) 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 19:30:29 1993 by Rik Faith (faith@cs.unc.edu)
29 .\" Modified Fri Feb 14 21:47:50 1997 by Andries Brouwer (aeb@cwi.nl)
30 .\"
31 .\" Japanese Version Copyright (c) 1997 Taro Morioka
32 .\"         all rights reserved.
33 .\" Translated Tue 08 04 06:00:00 JST 1997
34 .\"         by Tarho Morioka (t-morioka@nri.co.jp)
35 .\" Modified 2003-09-27 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
36 .\" Updated 2008-08-07, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
37 .\"
38 .TH GETENV 3  2008-03-17 "GNU" "Linux Programmer's Manual"
39 .\"O .SH NAME
40 .\"O getenv \- get an environment variable
41 .SH Ì¾Á°
42 getenv \- ´Ä¶­ÊÑ¿ô¤òÆÀ¤ë
43 .\"O .SH SYNOPSIS
44 .SH ½ñ¼°
45 .nf
46 .B #include <stdlib.h>
47 .sp
48 .BI "char *getenv(const char *" name );
49 .fi
50 .\"O .SH DESCRIPTION
51 .SH ÀâÌÀ
52 .\"O The
53 .\"O .BR getenv ()
54 .\"O function searches the environment list to find the
55 .\"O environment variable
56 .\"O .IR name ,
57 .\"O and returns a pointer to the corresponding
58 .\"O .I value
59 .\"O string.
60 ´Ø¿ô
61 .BR getenv ()
62 ¤Ï¡¢´Ä¶­¥ê¥¹¥È¤«¤é̾Á°¤¬
63 .I name
64 ¤Î´Ä¶­ÊÑ¿ô¤ò¸¡º÷¤·¡¢Âбþ¤¹¤ë
65 .I value
66 ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
67 .\"O .SH "RETURN VALUE"
68 .SH ÊÖ¤êÃÍ
69 .\"O The
70 .\"O .BR getenv ()
71 .\"O function returns a pointer to the value in the
72 .\"O environment, or NULL if there is no match.
73 ´Ø¿ô
74 .BR getenv ()
75 ¤Ï¡¢´Ä¶­¤Ë¤ª¤±¤ëÃÍ value ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
76 \fIname\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë´Ä¶­ÊÑ¿ô¤¬Â¸ºß¤·¤Ê¤¤¤È¤­¤Ë¤Ï NULL ¤òÊÖ¤¹¡£
77 .\"O .SH "CONFORMING TO"
78 .SH ½àµò
79 SVr4, POSIX.1-2001, 4.3BSD, C89, C99.
80 .\"O .SH NOTES
81 .SH Ãí°Õ
82 .\"O The strings in the environment list are of the form \fIname=value\fP.
83 ´Ä¶­¥ê¥¹¥È¤Îʸ»úÎó¤Ï \fIname=value\fP ¤È¤¤¤¦·Á¼°¤ò¤·¤Æ¤¤¤ë¡£
84
85 .\"O As typically implemented,
86 .\"O .BR getenv ()
87 .\"O returns a pointer to a string within the environment list.
88 .\"O The caller must take care not to modify this string,
89 .\"O since that would change the environment of the process.
90 Ä̾ï¤Î¼ÂÁõ¤Ç¤Ï¡¢
91 .BR getenv ()
92 ¤Ï´Ä¶­¥ê¥¹¥ÈÆâ¤Îʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
93 ¸Æ¤Ó½Ð¤·¸µ¤Ï¤³¤Îʸ»úÎó¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
94 ¤³¤Îʸ»úÎó¤òÊѹ¹¤¹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Î´Ä¶­¤òÊѲ½¤µ¤»¤ë¤³¤È¤Ë¤Ê¤ë¤«¤é¤Ç¤¢¤ë¡£
95
96 .\"O The implementation of
97 .\"O .BR getenv ()
98 .\"O is not required to be reentrant.
99 .\"O The string pointed to by the return value of
100 .\"O .BR getenv ()
101 .\"O may be statically allocated,
102 .\"O and can be modified by a subsequent call to
103 .\"O .BR getenv (),
104 .\"O .BR putenv (3),
105 .\"O .BR setenv (3),
106 .\"O or
107 .\"O .BR unsetenv (3).
108 .BR getenv ()
109 ¤Î¼ÂÁõ¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È (ºÆÆþ²Äǽ) ¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤵ¤ì¤Æ¤¤¤Ê¤¤¡£
110 .BR getenv ()
111 ¤ÎÊÖ¤êÃͤˤè¤ê»²¾È¤µ¤ì¤ëʸ»úÎó¤ÏÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤â¤è¤¯¡¢
112 ʸ»úÎó¤ÎÆâÍƤϸ峤Î
113 .BR getenv (),
114 .BR putenv (3),
115 .BR setenv (3),
116 .BR unsetenv (3)
117 ¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤êÊѹ¹¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£
118 .\"O .SH "SEE ALSO"
119 .SH ´ØÏ¢¹àÌÜ
120 .BR clearenv (3),
121 .BR putenv (3),
122 .BR setenv (3),
123 .BR unsetenv (3),
124 .BR environ (7)