.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (c) 2006, Michael Kerrisk .\" .\" 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. .\" .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. .\" Translated 2006-07-31, Akihiro MOTOKI .\" Updated 2009-02-23, Akihiro MOTOKI , LDP v3.18 .\" .TH FEXECVE 3 2010-09-15 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O fexecve \- execute program specified via file descriptor fexecve \- ファイルディスクリプタで指定されたプログラムを実行する .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "int fexecve(int " fd ", char *const " argv "[], char *const " envp []); .fi .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .BR fexecve (): .PD 0 .ad l .RS 4 .TP 4 .\"O Since glibc 2.10: glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L .TP .\"O Before glibc 2.10: glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD .\"O .SH DESCRIPTION .SH 説明 .\"O .BR fexecve () .\"O performs the same task as .\"O .BR execve (2), .\"O with the difference that the file to be executed .\"O is specified via a file descriptor, .\"O .IR fd , .\"O rather than via a pathname. .BR fexecve () は .BR execve (2) と同じ作業を行う。違うのは、 実行するファイルを、パス名ではなく、 ファイルディスクリプタ .I fd を用いて指定する点である。 .\"O The file descriptor .\"O .I fd .\"O must be opened read-only, .\"O and the caller must have permission to execute the file that it refers to. ファイルディスクリプタ .I fd は、読み込み専用でオープンされていなければならず、 呼び出し元はファイルディスクリプタが参照するファイルに対する 実行許可を持っていなければならない。 .\" POSIX.1-2008 specifies the O_EXEC flag for open as an alternative, .\" but Linux doesn't support this flag yet. .\"O .SH "RETURN VALUE" .SH 返り値 .\"O A successful call to .\"O .BR fexecve () .\"O never returns. .\"O On error, the function returns, with a result value of \-1, and .\"O .I errno .\"O is set appropriately. .BR fexecve () は呼び出しに成功した場合、戻ることはない。 エラーの場合、返り値として \-1 が返され、 .I errno が適切に設定される。 .\"O .SH ERRORS .SH エラー .\"O Errors are as for .\"O .BR execve (2), .\"O with the following additions: エラーは .BR execve (2) と同じだが、以下のエラーが追加になっている: .TP .B EINVAL .\"O .I fd .\"O is not a valid file descriptor, or .\"O .I argv .\"O is NULL, or .\"O .I envp .\"O is NULL. .I fd が有効なファイルディスクリプタでない。または .I argv が NULL である。または .I envp が NULL である。 .TP .B ENOSYS .\"O The .\"O .I /proc .\"O file system could not be accessed. .I /proc ファイルシステムにアクセスできなかった。 .\"O .SH VERSIONS .SH バージョン .\"O .BR fexecve () .\"O is implemented since glibc 2.3.2. .BR fexecve () は glibc 2.3.2 以降で実装されている。 .\"O .SH "CONFORMING TO" .SH 準拠 POSIX.1-2008. .\"O This function is not specified in POSIX.1-2001, .\"O and is not widely available on other systems. この関数は POSIX.1-2001 では規定されておらず、 他のシステムで広く利用できるわけではない。 .\"O .SH NOTES .SH 注意 .\"O On Linux, .\"O .BR fexecve () .\"O is implemented using the .\"O .BR proc (5) .\"O file system, so .\"O .I /proc .\"O needs to be mounted and available at the time of the call. Linux では、 .BR fexecve () は .BR proc (5) ファイルシステムを使って実装されている。 そのため、この関数を呼び出す時点では .I /proc がマウントされて利用可能となっている必要がある。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR execve (2)