.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" This manpage is 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. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH FSTATAT 2 2012\-05\-04 Linux "Linux Programmer's Manual" .SH 名前 fstatat \- ディレクトリファイルディスクリプタから相対的な位置にあるファイルの状態を取得する .SH 書式 .nf \fB#include /* AT_* 定数の定義 */\fP \fB#include \fP .sp \fBint fstatat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, struct stat *\fP\fIbuf\fP\fB,\fP \fB int \fP\fIflags\fP\fB);\fP .fi .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp \fBfstatat\fP(): .PD 0 .ad l .RS 4 .TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L .TP glibc 2.10 より前: _ATFILE_SOURCE .RE .ad .PD .SH 説明 \fBfstatat\fP() システムコールは、この man ページで説明している違いがある以外は、 \fBstat\fP(2) と全く同じように動作する。 \fIpathname\fP で指定されるパス名が相対パスである場合、 ファイルディスクリプタ \fIdirfd\fP で参照されるディレクトリからの相対パス名として解釈される (\fBstat\fP(2) では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの 相対パスとなる)。 \fIpathname\fP が相対パスであり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIpathname\fP は (\fBstat\fP(2) と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。 \fIpathname\fP が絶対パスである場合、 \fIdirfd\fP は無視される。 \fIflags\fP には 0 または以下のフラグの 1 つ以上を論理和 (OR) で指定する。 .TP \fBAT_NO_AUTOMOUNT\fP (Linux 2.6.38 以降) \fIpathname\fP がオートマウントポイントのディレクトリの場合、 \fIpathname\fP の最後の要素 ("basename") のオートマウントを行わない。 このフラグを使うと、(マウント先の場所ではなく) オートマウントポイント 自身の属性を収集することができる。 ディレクトリをスキャンするようなツールで、オートマウントポイントを 含むディレクトリで大量のオートマウントが起こらないようにするのに、 このフラグを使うことができる。 マウントポイントがすでにマウントされている場合には、 \fBAT_NO_AUTOMOUNT\fP フラグは何も効果はない。 .TP \fBAT_SYMLINK_NOFOLLOW\fP \fIpathname\fP がシンボリックリンクの場合は、それを辿るのではなく、 \fBlstat\fP(2) と同様にリンク自身についての情報を返す (デフォルトでは、 \fBfstatat\fP() は \fBstat\fP(2) と同様にシンボリックリンクを辿る)。 .SH 返り値 成功した場合、 \fBfstatat\fP() は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。 .SH エラー \fBstat\fP(2) と同じエラーが \fBfstatat\fP() でも起こる。 \fBfstatat\fP() では、その他に以下のエラーが起こる: .TP \fBEBADF\fP \fIdirfd\fP が有効なファイルディスクリプタでない。 .TP \fBEINVAL\fP \fIflags\fP に不正なフラグ値が指定された。 .TP \fBENOTDIR\fP \fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 .SH バージョン \fBfstatat\fP() は Linux カーネル 2.6.16 で追加された。 ライブラリによるサポートは glibc バージョン 2.4 で追加された。 .SH 準拠 POSIX.1\-2008. Solaris には、これと同じようなシステムコールが存在する。 .SH 注意 \fBfstatat\fP() が必要な理由については、 \fBopenat\fP(2) を参照すること。 glibc の \fBfstatat\fP() のラッパー関数が利用するシステムコールとしては、 実際には \fBfstatat64\fP() が呼び出される。 .SH 関連項目 \fBopenat\fP(2), \fBstat\fP(2), \fBpath_resolution\fP(7), \fBsymlink\fP(7), .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.41 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。