fexecveのヘルプ・マニュアル
日本語 英語
fexecve --help
man fexecve
FEXECVE(3) Linux Programmer’s Manual FEXECVE(3)
名前
fexecve - ファイルディスクリプタで指定されたプログラムを実行する
書式
#define _GNU_SOURCE
#include
int fexecve(int fd, char *const argv[], char *const envp[]);
説明
fexecve() は execve(2) と同じ作業を行う。違うのは、実行するファイルを、
パス名ではなく、ファイルディスクリプタ fd を用いて指定する点である。 フ
ァ イルディスクリプタ fd は、読み込み専用でオープンされていなければなら
ず、呼び出し元はファイルディスクリプタが参照するファイルに対する実行 許
可を持っていなければならない。
返り値
fexecve() は呼び出しに成功した場合、戻ることはない。エラーの場合、返り
値として -1 が返され、 errno が適切に設定される。
エラー
エラーは execve(2) と同じだが、以下のエラーが追加になっている:
EINVAL fd が有効なファイルディスクリプタでない。または argv が NULL で
ある。または envp が NULL である。
ENOSYS /proc ファイルシステムにアクセスできなかった。
バージョン
fexecve() は glibc 2.3.2 以降で実装されている。
準拠
POSIX.1-2008. この関数は POSIX.1-2001 では規定されておらず、他のシステ
ムで広く利用できるわけではない。
注意
Linux では、 fexecve() は proc(5) ファイルシステムを使って実装されて い
る。そのため、この関数を呼び出す時点では /proc がマウントされて利用可能
となっている必要がある。
関連項目
execve(2)
Linux 2009-02-04 FEXECVE(3)
FEXECVE(3) Linux Programmer’s Manual FEXECVE(3)
NAME
fexecve - execute program specified via file descriptor
SYNOPSIS
#define _GNU_SOURCE
#include
int fexecve(int fd, char *const argv[], char *const envp[]);
DESCRIPTION
fexecve() performs the same task as execve(2), with the difference that
the file to be executed is specified via a file descriptor, fd, rather
than via a pathname. The file descriptor fd must be opened read-only,
and the caller must have permission to execute the file that it refers
to.
RETURN VALUE
A successful call to fexecve() never returns. On error, the function
returns, with a result value of -1, and errno is set appropriately.
ERRORS
Errors are as for execve(2), with the following additions:
EINVAL fd is not a valid file descriptor, or argv is NULL, or envp is
NULL.
ENOSYS The /proc file system could not be accessed.
VERSIONS
fexecve() is implemented since glibc 2.3.2.
CONFORMING TO
POSIX.1-2008. This function is not specified in POSIX.1-2001, and is
not widely available on other systems.
NOTES
On Linux, fexecve() is implemented using the proc(5) file system, so
/proc needs to be mounted and available at the time of the call.
SEE ALSO
execve(2)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2009-02-04 FEXECVE(3)