OSDN Git Service

(split) LDP v3.30, v3.31 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / fexecve.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 2006, Michael Kerrisk
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
26 .\" Translated 2006-07-31, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
27 .\" Updated 2009-02-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.18
28 .\"
29 .TH FEXECVE 3 2010-09-15 "Linux" "Linux Programmer's Manual"
30 .\"O .SH NAME
31 .SH Ì¾Á°
32 .\"O fexecve \- execute program specified via file descriptor
33 fexecve \- ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç»ØÄꤵ¤ì¤¿¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë
34 .\"O .SH SYNOPSIS
35 .SH ½ñ¼°
36 .nf
37 .B #include <unistd.h>
38 .sp
39 .BI "int fexecve(int " fd ", char *const " argv "[], char *const " envp []);
40 .fi
41 .sp
42 .in -4n
43 .\"O Feature Test Macro Requirements for glibc (see
44 .\"O .BR feature_test_macros (7)):
45 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
46 .RB ( feature_test_macros (7)
47 »²¾È):
48 .in
49 .sp
50 .BR fexecve ():
51 .PD 0
52 .ad l
53 .RS 4
54 .TP 4
55 .\"O Since glibc 2.10:
56 glibc 2.10 °Ê¹ß:
57 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
58 .TP
59 .\"O Before glibc 2.10:
60 glibc 2.10 ¤è¤êÁ°:
61 _GNU_SOURCE
62 .RE
63 .ad
64 .PD
65 .\"O .SH DESCRIPTION
66 .SH ÀâÌÀ
67 .\"O .BR fexecve ()
68 .\"O performs the same task as
69 .\"O .BR execve (2),
70 .\"O with the difference that the file to be executed
71 .\"O is specified via a file descriptor,
72 .\"O .IR fd ,
73 .\"O rather than via a pathname.
74 .BR fexecve ()
75 ¤Ï
76 .BR execve (2)
77 ¤ÈƱ¤¸ºî¶È¤ò¹Ô¤¦¡£°ã¤¦¤Î¤Ï¡¢
78 ¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¤ò¡¢¥Ñ¥¹Ì¾¤Ç¤Ï¤Ê¤¯¡¢
79 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
80 .I fd
81 ¤òÍѤ¤¤Æ»ØÄꤹ¤ëÅÀ¤Ç¤¢¤ë¡£
82 .\"O The file descriptor
83 .\"O .I fd
84 .\"O must be opened read-only,
85 .\"O and the caller must have permission to execute the file that it refers to.
86 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
87 .I fd
88 ¤Ï¡¢Æɤ߹þ¤ßÀìÍѤǥª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢
89 ¸Æ¤Ó½Ð¤·¸µ¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë
90 ¼Â¹Ôµö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
91 .\" POSIX.1-2008 specifies the O_EXEC flag for open as an alternative,
92 .\" but Linux doesn't support this flag yet.
93 .\"O .SH "RETURN VALUE"
94 .SH ÊÖ¤êÃÍ
95 .\"O A successful call to
96 .\"O .BR fexecve ()
97 .\"O never returns.
98 .\"O On error, the function returns, with a result value of \-1, and
99 .\"O .I errno
100 .\"O is set appropriately.
101 .BR fexecve ()
102 ¤Ï¸Æ¤Ó½Ð¤·¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢Ìá¤ë¤³¤È¤Ï¤Ê¤¤¡£
103 ¥¨¥é¡¼¤Î¾ì¹ç¡¢ÊÖ¤êÃͤȤ·¤Æ \-1 ¤¬ÊÖ¤µ¤ì¡¢
104 .I errno
105 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
106 .\"O .SH ERRORS
107 .SH ¥¨¥é¡¼
108 .\"O Errors are as for
109 .\"O .BR execve (2),
110 .\"O with the following additions:
111 ¥¨¥é¡¼¤Ï
112 .BR execve (2)
113 ¤ÈƱ¤¸¤À¤¬¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬ÄɲäˤʤäƤ¤¤ë:
114 .TP
115 .B EINVAL
116 .\"O .I fd
117 .\"O is not a valid file descriptor, or
118 .\"O .I argv
119 .\"O is NULL, or
120 .\"O .I envp
121 .\"O is NULL.
122 .I fd
123 ¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£¤Þ¤¿¤Ï
124 .I argv
125 ¤¬ NULL ¤Ç¤¢¤ë¡£¤Þ¤¿¤Ï
126 .I envp
127 ¤¬ NULL ¤Ç¤¢¤ë¡£
128 .TP
129 .B ENOSYS
130 .\"O The
131 .\"O .I /proc
132 .\"O file system could not be accessed.
133 .I /proc
134 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¡£
135 .\"O .SH VERSIONS
136 .SH ¥Ð¡¼¥¸¥ç¥ó
137 .\"O .BR fexecve ()
138 .\"O is implemented since glibc 2.3.2.
139 .BR fexecve ()
140 ¤Ï glibc 2.3.2 °Ê¹ß¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
141 .\"O .SH "CONFORMING TO"
142 .SH ½àµò
143 POSIX.1-2008.
144 .\"O This function is not specified in POSIX.1-2001,
145 .\"O and is not widely available on other systems.
146 ¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ç¤Ïµ¬Äꤵ¤ì¤Æ¤ª¤é¤º¡¢
147 ¾¤Î¥·¥¹¥Æ¥à¤Ç¹­¤¯ÍøÍѤǤ­¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£
148 .\"O .SH NOTES
149 .SH Ãí°Õ
150 .\"O On Linux,
151 .\"O .BR fexecve ()
152 .\"O is implemented using the
153 .\"O .BR proc (5)
154 .\"O file system, so
155 .\"O .I /proc
156 .\"O needs to be mounted and available at the time of the call.
157 Linux ¤Ç¤Ï¡¢
158 .BR fexecve ()
159 ¤Ï
160 .BR proc (5)
161 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»È¤Ã¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
162 ¤½¤Î¤¿¤á¡¢¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹»þÅÀ¤Ç¤Ï
163 .I /proc
164 ¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤ÆÍøÍѲÄǽ¤È¤Ê¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£
165 .\"O .SH "SEE ALSO"
166 .SH ´ØÏ¢¹àÌÜ
167 .BR execve (2)