OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / exec.3
1 .\" Copyright (c) 1991 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)exec.3      6.4 (Berkeley) 4/19/91
33 .\"
34 .\" Converted for Linux, Mon Nov 29 11:12:48 1993, faith@cs.unc.edu
35 .\" Updated more for Linux, Tue Jul 15 11:54:18 1997, pacman@cqc.com
36 .\" Modified, 24 Jun 2004, Michael Kerrisk <mtk.manpages@gmail.com>
37 .\"     Added note on casting NULL
38 .\"
39 .\" Japanese Version Copyright (c) 1998 Masato Taruishi
40 .\"         all rights reserved.
41 .\" Translated 1998-05-27, Masato Taruishi
42 .\" Modified 1998-08-08, Fujiwara Teruyoshi <fujiwara@linux.or.jp>
43 .\" Modified 2000-10-06, Kentaro Shirakata <argrath@ub32.org>
44 .\" Modified 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
45 .\" Updated 2010-10-27, Akihiro Motoki <amotoki@dd.iij4u.or.jp>, LDP v3.29
46 .\"
47 .\"WORD:        null-terminated strings    NULL¤Ç½ª¤ï¤ëʸ»úÎó
48 .\"WORD:        anti-Trojan-horse measure  ¥È¥í¥¤¤ÎÌÚÇÏÂкö
49 .\"WORD:        external variable          ³°ÉôÊÑ¿ô
50 .\"WORD:        current  directory first   ¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤¬ºÇ½é
51 .\"WORD:        the attempted execve       ¸Æ¤Ó½Ð¤½¤¦¤È¤·¤¿execve
52 .\"WORD:        variadic function          ²ÄÊÑĹ°ú¤­¿ô´Ø¿ô
53 .\"WORD:        semantics                  (¥×¥í¥°¥é¥à¤Î)Æ°ºî
54 .\"
55 .TH EXEC 3  2010-09-25 "GNU" "Linux Programmer's Manual"
56 .\"O .SH NAME
57 .SH Ì¾Á°
58 .\"O execl, execlp, execle, execv, execvp, execvpe \- execute a file
59 execl, execlp, execle, execv, execvp, execvpe \- ¥Õ¥¡¥¤¥ë¤ò¼Â¹Ô¤¹¤ë
60 .\"O .SH SYNOPSIS
61 .SH ½ñ¼°
62 .B #include <unistd.h>
63 .sp
64 .B extern char **environ;
65 .sp
66 .BI "int execl(const char *" path ", const char *" arg ", ...);"
67 .br
68 .BI "int execlp(const char *" file ", const char *" arg ", ...);"
69 .br
70 .BI "int execle(const char *" path ", const char *" arg ,
71 .br
72 .BI "           ..., char * const " envp "[]);"
73 .br
74 .BI "int execv(const char *" path ", char *const " argv "[]);"
75 .br
76 .BI "int execvp(const char *" file ", char *const " argv "[]);"
77 .br
78 .BI "int execvpe(const char *" file ", char *const " argv "[],"
79 .br
80 .BI "           char *const " envp "[]);"
81 .sp
82 .in -4n
83 .\"O Feature Test Macro Requirements for glibc (see
84 .\"O .BR feature_test_macros (7)):
85 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
86 .RB ( feature_test_macros (7)
87 »²¾È):
88 .in
89 .sp
90 .BR execvpe ():
91 _GNU_SOURCE
92 .\"O .SH DESCRIPTION
93 .SH ÀâÌÀ
94 .\"O The
95 .\"O .BR exec ()
96 .\"O family of functions replaces the current process image with a new process
97 .\"O image.
98 .\"O The functions described in this manual page are front-ends for
99 .\"O .BR execve (2).
100 .\"O (See the manual page for
101 .\"O .BR execve (2)
102 .\"O for further details about the replacement of the current process image.)
103 .BR exec ()
104 ¥Õ¥¡¥ß¥ê¡¼¤Î´Ø¿ô¤Ï¸½ºß¤Î¥×¥í¥»¥¹¥¤¥á¡¼¥¸¤ò¿·¤·¤¤¥×¥í¥»¥¹¥¤¥á¡¼¥¸¤ÇÃÖ¤­
105 ´¹¤¨¤ë¡£¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë´Ø¿ô¤Ï
106 .BR execve (2)
107 ¤Î¥Õ¥í¥ó¥È¥¨¥ó¥É¤Ç¤¢¤ë¡£
108 (¸½ºß¤Î¥×¥í¥»¥¹¥¤¥á¡¼¥¸¤ÎÃÖ¤­´¹¤¨¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤Ï
109 .BR execve (2)
110 ¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È)
111 .PP
112 .\"O The initial argument for these functions is the name of a file that is
113 .\"O to be executed.
114 ¤³¤ì¤é¤Î´Ø¿ô¤ÎºÇ½é¤Î°ú¤­¿ô¤Ï¡¢¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î̾Á°¤Ç¤¢¤ë¡£
115 .PP
116 .\"O The
117 .\"O .I "const char *arg"
118 .\"O and subsequent ellipses in the
119 .\"O .BR execl (),
120 .\"O .BR execlp (),
121 .\"O and
122 .\"O .BR execle ()
123 .\"O functions can be thought of as
124 .\"O .IR arg0 ,
125 .\"O .IR arg1 ,
126 .\"O \&...,
127 .\"O .IR argn .
128 ´Ø¿ô
129 .BR execl (),
130 .BR execlp (),
131 .BR execle ()
132 ¤Î
133 .I "const char *arg"
134 ¤È¤½¤ì¤Ë³¤¯¾ÊάÉôʬ¤Ï
135 .IR arg0 ,
136 .IR arg1 ,
137 \&...,
138 .I argn
139 ¤È¤ß¤Ê¤µ¤ì¤ë¡£
140 .\"O Together they describe a list of one or more pointers to null-terminated
141 .\"O strings that represent the argument list available to the executed program.
142 .\"O The first argument, by convention, should point to the filename associated
143 .\"O with the file being executed.
144 .\"O The list of arguments
145 .\"O .I must
146 .\"O be terminated by a NULL
147 .\"O pointer, and, since these are variadic functions, this pointer must be cast
148 .\"O .IR "(char *) NULL" .
149 ¤³¤ì¤é¤Ë¤Ï¡¢¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤ÇÍøÍѲÄǽ¤Ê°ú¤­¿ô¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë
150 (°ú¤­¿ô¤Î¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¤é¹½À®¤µ¤ì¤ë)¡£
151 ´·½¬¤È¤·¤Æ¡¢ºÇ½é¤Î°ú¤­¿ô¤Ï¡¢¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë̾
152 ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ë¤¹¤ë¡£°ú¤­¿ô¤Î¥ê¥¹¥È¤Ïɬ¤º NULL
153 ¤Ç½ª¤ï¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï²ÄÊÑĹ°ú¤­¿ô´Ø¿ô¤Ê¤Î¤Ç¡¢
154 ¤³¤Î¥Ý¥¤¥ó¥¿¤Ï
155 .I "(char *) NULL"
156 ¤È¥­¥ã¥¹¥È¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
157 .PP
158 .\"O The
159 .\"O .BR execv (),
160 .\"O .BR execvp (),
161 .\"O and
162 .\"O .BR execvpe ()
163 .\"O functions provide an array of pointers to null-terminated strings that
164 .\"O represent the argument list available to the new program.
165 .\"O The first argument, by convention, should point to the filename
166 .\"O associated with the file being executed.
167 .\"O The array of pointers
168 .\"O .I must
169 .\"O be terminated by a NULL pointer.
170 ´Ø¿ô
171 .BR execv (),
172 .BR execvp (),
173 .BR execvpe ()
174 ¤Ï¡¢ÍøÍѲÄǽ¤Ê°ú¤­¿ô¥ê¥¹¥È (NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î
175 ¥Ý¥¤¥ó¥¿¤ÎÇÛÎó) ¤ò¿·¤·¤¤¥×¥í¥°¥é¥à¤ËÅϤ¹¡£
176 ´·½¬¤È¤·¤Æ¡¢ºÇ½é¤Î°ú¤­¿ô¤Ï¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë̾¤Ø
177 ¤Î¥Ý¥¤¥ó¥¿¤Ë¤¹¤ë¡£¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ïɬ¤º
178 NULL ¤Ç½ª¤ï¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
179 .PP
180 .\"O The
181 .\"O .BR execle ()
182 .\"O and
183 .\"O .BR execvpe ()
184 .\"O functions allow the caller to specify the environment of the
185 .\"O executed program via the argument
186 .\"O .IR envp .
187 ´Ø¿ô
188 .BR execle (),
189 .BR execvpe ()
190 ¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤¬°ú¤­¿ô
191 .I envp
192 ·Ðͳ¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤Î´Ä¶­¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
193 .\"O The
194 .\"O .I envp
195 .\"O argument is an array of pointers to null-terminated strings and
196 .\"O .I must
197 .\"O be terminated by a NULL pointer.
198 .\"O The other functions take the environment for the new process
199 .\"O image from the external variable
200 .\"O .I environ
201 .\"O in the calling process.
202 .I envp
203 °ú¤­¿ô¤Ï¡¢NULL ¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ÎÇÛÎó¤Ç¤¢¤ê¡¢
204 NULL ¥Ý¥¤¥ó¥¿¤Ç½ª¤ï¤é¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
205 ¾¤Î´Ø¿ô¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î³°ÉôÊÑ¿ô
206 .B environ
207 ¤«¤é¿·¤·¤¤¥×¥í¥»¥¹ÍѤδĶ­¤òÍ¿¤¨¤ë¡£
208 .\"O .SS Special semantics for execlp() and execvp()
209 .SS execlp() ¤È execvp() ¤ÎÆÃÊ̤ÊÆ°ºî
210 .PP
211 .\"O The
212 .\"O .BR execlp (),
213 .\"O .BR execvp (),
214 .\"O and
215 .\"O .BR execvpe ()
216 .\"O functions duplicate the actions of the shell in
217 .\"O searching for an executable file
218 .\"O if the specified filename does not contain a slash (/) character.
219 ´Ø¿ô
220 .BR execlp (),
221 .BR execvp (),
222 .BR execvpe ()
223 ¤Ï¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤¬¥¹¥é¥Ã¥·¥å (/) ¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤¾ì¹ç¡¢
224 ¥·¥§¥ë¤ÈƱ¤¸Æ°ºî¤Ç¼Â¹Ô²Äǽ¤Ê¥Õ¥¡¥¤¥ë¤òõº÷¤¹¤ë¡£
225 .\"O The file is sought in the colon-separated list of directory pathnames
226 .\"O specified in the
227 .\"O .B PATH
228 .\"O environment variable.
229 .\"O If this variable isn't defined, the path list defaults to
230 .\"O the current directory followed by the list of directories returned by
231 .\"O .IR confstr(_CS_PATH) .
232 .\"O (This
233 .\"O .BR confstr (3)
234 .\"O call typically returns the value "/bin:/usr/bin".)
235 ¥Õ¥¡¥¤¥ë¤Î¸¡º÷¤Ï¡¢´Ä¶­ÊÑ¿ô
236 .B PATH
237 ¤Ç»ØÄꤵ¤ì¤¿¥³¥í¥ó¶èÀÚ¤ê¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹Ì¾¤Î¥ê¥¹¥È¤òÂоݤ˹Ԥï¤ì¤ë¡£
238 ¤³¤ÎÊÑ¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥Ñ¥¹Ì¾¤Î¥ê¥¹¥È¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤȤ·¤Æ¡¢
239 ¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¸å¤í¤Ë¡¢
240 .I confstr(_CS_PATH)
241 ¤¬ÊÖ¤¹¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤ò¤Ä¤Ê¤²¤¿Ãͤ¬»ÈÍѤµ¤ì¤ë (¤³¤Î
242 .BR confstr (3)
243 ¤Î¸Æ¤Ó½Ð¤·¤Ç¤ÏÄ̾ï "/bin:/usr/bin" ¤¬ÊÖ¤µ¤ì¤ë)¡£
244
245 .\"O If the specified filename includes a slash character, then
246 .\"O .B PATH
247 .\"O is ignored, and the file at the specified pathname is executed.
248 »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤¬¥¹¥é¥Ã¥·¥å¤ò´Þ¤à¾ì¹ç¡¢
249 .B PATH
250 ¤Ï̵»ë¤µ¤ì¡¢»ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤Î¥Õ¥¡¥¤¥ë¤¬¼Â¹Ô¤µ¤ì¤ë¡£
251
252 .\"O In addition, certain errors are treated specially.
253 ¤µ¤é¤Ë¡¢¤¤¤¯¤Ä¤«¤Î¥¨¥é¡¼¤ÏÆÃÊ̤˽èÍý¤µ¤ì¤ë¡£
254
255 .\"O If permission is denied for a file (the attempted
256 .\"O .BR execve (2)
257 .\"O failed with the error
258 .\"O .BR EACCES ),
259 .\"O these functions will continue searching the rest of the search path.
260 .\"O If no other file is found, however,
261 .\"O they will return with
262 .\"O .I errno
263 .\"O set to
264 .\"O .BR EACCES .
265 ¥Õ¥¡¥¤¥ë¤¬¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ç¤Ê¤¤¾ì¹ç (¤³¤Î¤È¤­¸Æ¤Ó½Ð¤½¤¦¤È¤·¤¿
266 .BR execve (2)
267 ¤Ï¥¨¥é¡¼
268 .B EACCES
269 ¤Ç¼ºÇÔ¤¹¤ë)¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï»Ä¤ê¤Î¸¡º÷¥Ñ¥¹¤Î¸¡º÷¤ò³¤±¤ë¡£
270 ¾¤Ë¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¯¤Ê¤Ã¤¿¾ì¹ç
271 .I errno
272 ¤Ë
273 .B EACCES
274 ¤òÀßÄꤷÉüµ¢¤¹¤ë¡£
275 .\" fujiwara: ¸Ä¿ÍŪ¤Ë¤Ï¡ÖÉüµ¢¤¹¤ë¡×¤ÎÊý¤¬¹¥¤­(^_^;
276
277 .\"O If the header of a file isn't recognized (the attempted
278 .\"O .BR execve (2)
279 .\"O failed with the error
280 .\"O .BR ENOEXEC ),
281 .\"O these functions will execute the shell
282 .\"O .RI ( /bin/sh )
283 .\"O with the path of the file as its first argument.
284 .\"O (If this attempt fails, no further searching is done.)
285 ¥Õ¥¡¥¤¥ë¤Î¥Ø¥Ã¥À¤¬¼Â¹Ô·Á¼°¤È¤·¤Æǧ¼±¤Ç¤­¤Ê¤¤¾ì¹ç
286 (¤³¤Î¤È¤­¸Æ¤Ó½Ð¤½¤¦¤È¤·¤¿
287 .BR execve (2)
288 ¤Ï¥¨¥é¡¼
289 .B ENOEXEC
290 ¤Ç¼ºÇÔ¤¹¤ë)¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¤½¤Î¥Õ¥¡¥¤¥ë¤òºÇ½é¤Î°ú¤­¿ô¤È¤·¤¿¥·¥§¥ë
291 .RI ( /bin/sh )
292 ¤ò¼Â¹Ô¤¹¤ë (¤³¤ì¤Ë¤â¼ºÇÔ¤·¤¿¾ì¹ç¡¢¤³¤ì°Ê¾å¤Î¸¡º÷¤Ï¹Ô¤ï¤ì¤Ê¤¤)¡£
293 .\"O .SH "RETURN VALUE"
294 .SH ÊÖ¤êÃÍ
295 .\"O The
296 .\"O .BR exec ()
297 .\"O functions only return if an error has have occurred.
298 .\"O The return value is \-1, and
299 .\"O .I errno
300 .\"O is set to indicate the error.
301 .BR exec ()
302 ·²¤Î´Ø¿ô¤¬Éüµ¢¤¹¤ë¤Î¤Ï¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Î¤ß¤Ç¤¢¤ë¡£
303 ÊÖ¤êÃͤϠ\-1 ¤Ç¡¢
304 .I errno
305 ¤Ë¥¨¥é¡¼¤ÎÆâÍƤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£
306 .\"O .SH ERRORS
307 .SH ¥¨¥é¡¼
308 .\"O All of these functions may fail and set
309 .\"O .I errno
310 .\"O for any of the errors specified for
311 .\"O .BR execve (2).
312 ¤³¤ì¤éÁ´¤Æ¤Î´Ø¿ô¤Ï¼ºÇÔ¤¹¤ë¾ì¹ç¤¬¤¢¤ë¡£¤½¤Î¾ì¹ç¡¢
313 .BR execve (2)
314 ¤ËÂФ·¤Æµ¬Äꤵ¤ì¤¿¥¨¥é¡¼¤¬
315 .I errno
316 ¤ËÀßÄꤵ¤ì¤ë¡£
317 .\"O .SH VERSIONS
318 .SH ¥Ð¡¼¥¸¥ç¥ó
319 .\"O The
320 .\"O .BR execvpe ()
321 .\"O function first appeared in glibc 2.11.
322 .BR execvpe ()
323 ´Ø¿ô¤Ï glibc 2.11 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
324 .\"O .SH "CONFORMING TO"
325 .SH ½àµò
326 POSIX.1-2001, POSIX.1-2008.
327
328 .\"O The
329 .\"O .BR execvpe ()
330 .\"O function is a GNU extension.
331 .BR execvpe ()
332 ´Ø¿ô¤Ï GNU ¤Ë¤è¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
333 .\"O .SH NOTES
334 .SH Ãí°Õ
335 .\"O On some other systems, the default path (used when the environment
336 .\"O does not contain the variable \fBPATH\fR) has the current working
337 .\"O directory listed after
338 .\"O .I /bin
339 .\"O and
340 .\"O .IR /usr/bin ,
341 .\"O as an anti-Trojan-horse measure.
342 .\"O Linux uses here the
343 .\"O traditional "current directory first" default path.
344 Linux °Ê³°¤Î¥·¥¹¥Æ¥à¤Ë¤Ï¡¢
345 (´Ä¶­ÊÑ¿ô \fBPATH\fR ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Î)
346 ¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤Ë¤ª¤¤¤Æ¡¢¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤¬
347 .I /bin
348 ¤È
349 .I /usr/bin
350 ¤Î¸å¤í¤ËÇÛÃÖ¤µ¤ì¤ë¤â¤Î¤â¤¢¤ë¡£
351 ¤³¤ì¤Ï¥È¥í¥¤¤ÎÌÚÇÏÂкö¤Î¤¿¤á¤Ç¤¢¤ë¡£
352 Linux ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤Ë¡¢ÀΤʤ¬¤é¤Î¡Ö¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò
353 Àè¤Ëõº÷¡×¤È¤¤¤¦¥ë¡¼¥ë¤ò»È¤Ã¤Æ¤¤¤ë¡£
354 .PP
355 .\"O The behavior of
356 .\"O .BR execlp ()
357 .\"O and
358 .\"O .BR execvp ()
359 .\"O when errors occur while attempting to execute the file is historic
360 .\"O practice, but has not traditionally been documented and is not specified by
361 .\"O the POSIX standard.
362 .\"O BSD (and possibly other systems) do an automatic
363 .\"O sleep and retry if
364 .\"O .B ETXTBSY
365 .\"O is encountered.
366 .\"O Linux treats it as a hard
367 .\"O error and returns immediately.
368 ¥Õ¥¡¥¤¥ë¤ò¼Â¹Ô¤·¤è¤¦¤È¤·¤Æ¤¤¤ë´Ö¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿»þ¤Î
369 .BR execlp ()
370 ¤È
371 .BR execvp ()
372 ¤Î¤Õ¤ë¤Þ¤¤¤Ë¤Ä¤¤¤ÆÎò»ËŪ¤Ê´·½¬¤Ï¤¢¤ë¤¬¡¢ÅÁÅýŪ¤Ëʸ½ñ¤È¤·¤Æµ­ºÜ¤µ¤ì¤Æ¤ª¤é¤º¡¢
373 POSIX É¸½à¤Ç¤âµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£BSD (¤Þ¤¿¤ª¤½¤é¤¯Â¾¤Î¥·¥¹¥Æ¥à) ¤Ç¤Ï¡¢
374 .B ETXTBSY
375 ¤¬È¯À¸¤·¤¿¾ì¹ç¡¢¼«Æ°Åª¤ËÃæÃÇ (sleep) ¤·ºÆ»î¹Ô¤ò¹Ô¤¦¡£
376 Linux ¤Ï¤½¤ì¤ò¥Ï¡¼¥É¥¨¥é¡¼¤È¤·¤Æ¼è¤ê°·¤¤Â¨ºÂ¤ËÉüµ¢¤¹¤ë¡£
377 .PP
378 .\"O Traditionally, the functions
379 .\"O .BR execlp ()
380 .\"O and
381 .\"O .BR execvp ()
382 .\"O ignored all errors except for the ones described above and
383 .\"O .B ENOMEM
384 .\"O and
385 .\"O .BR E2BIG ,
386 .\"O upon which they returned.
387 .\"O They now return if any error other than the ones
388 .\"O described above occurs.
389 ÅÁÅýŪ¤Ë¡¢´Ø¿ô
390 .BR execlp ()
391 ¤È
392 .BR execvp ()
393 ¤Ï¡¢¾å¤ÇÀâÌÀ¤·¤¿¥¨¥é¡¼¤È¡¢¤³¤ì¤é 2 ¤Ä¤Î´Ø¿ô¼«¿È¤¬ÊÖ¤¹
394 .B ENOMEM
395 ¤È
396 .B E2BIG
397 °Ê³°¤ÎÁ´¤Æ¤Î¥¨¥é¡¼¤ò̵»ë¤·¤Æ¤¤¤¿¤¬¡¢
398 º£¤Ç¤Ï¡¢¾å¤ÇÀâÌÀ¤·¤¿°Ê³°¤Î¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ç¤â¡¢
399 Ê֤äƤ¯¤ë¤è¤¦Êѹ¹¤µ¤ì¤¿¡£
400 .\"O .SH "SEE ALSO"
401 .SH ´ØÏ¢¹àÌÜ
402 .BR sh (1),
403 .BR execve (2),
404 .BR fork (2),
405 .BR ptrace (2),
406 .BR fexecve (3),
407 .BR environ (7)