OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / release / man2 / fchmodat.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is 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 Yuichi SATO
26 .\"         all rights reserved.
27 .\" Translated 2006-10-14 by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v2.39
28 .\"
29 .TH FCHMODAT 2 2009-12-13 "Linux" "Linux Programmer's Manual"
30 .SH 名前
31 fchmodat \- ディレクトリファイルディスクリプタから相対的な位置にあるファイルのアクセス権を変更する
32 .SH 書式
33 .nf
34 .B #include <fcntl.h>           /* AT_* 定数の定義 */
35 .B #include <sys/stat.h>
36 .sp
37 .BI "int fchmodat(int " dirfd ", const char *" pathname ", mode_t " \
38 mode ", int " flags );
39 .fi
40 .sp
41 .in -4n
42 glibc 向けの機能検査マクロの要件
43 .RB ( feature_test_macros (7)
44 参照):
45 .in
46 .sp
47 .BR fchmodat ():
48 .PD 0
49 .ad l
50 .RS 4
51 .TP 4
52 glibc 2.10 以降:
53 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
54 .TP
55 glibc 2.10 より前:
56 _ATFILE_SOURCE
57 .RE
58 .ad
59 .PD
60 .SH 説明
61 .BR fchmodat ()
62 システムコールは、この man ページで説明している違いがある以外は、
63 .BR chmod (2)
64 と全く同じように動作する。
65
66 .I pathname
67 で指定されるパス名が相対パスである場合、
68 ファイルディスクリプタ
69 .I dirfd
70 で参照されるディレクトリからの相対パス名として解釈される
71 .RB ( chmod (2)
72 では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの
73 相対パスとなる)。
74
75 .I pathname
76 が相対パスであり、かつ
77 .I dirfd
78 が特別な値
79 .B AT_FDCWD
80 である場合、
81 .I pathname
82
83 .RB ( chmod (2)
84 と同じように) 呼び出し元プロセスの
85 カレントワーキングディレクトリからの相対パス名として解釈される。
86
87 .I pathname
88 が絶対パスである場合、
89 .I dirfd
90 は無視される。
91
92 .I flags
93 は 0 または以下のフラグである。
94 .TP
95 .B AT_SYMLINK_NOFOLLOW
96 .I pathname
97 がシンボリックリンクの場合は、それを辿るのではなく、
98 リンク自身に対して (アクセス権の変更の) 操作を行う。
99 このフラグは現在のところ実装されていない。
100 .SH 返り値
101 成功した場合、
102 .BR fchmodat ()
103 は 0 を返す。
104 エラーの場合、\-1 が返されて、
105 .I errno
106 にはエラーを示す値が設定される。
107 .SH エラー
108 .BR chmod (2)
109 と同じエラーが
110 .BR fchmodat ()
111 でも起こる。
112 .BR fchmodat ()
113 では、その他に以下のエラーが起こる:
114 .TP
115 .B EBADF
116 .I dirfd
117 が有効なファイルディスクリプタでない。
118 .TP
119 .B EINVAL
120 .I flags
121 に不正なフラグ値が指定された。
122 .TP
123 .B ENOTDIR
124 .I pathname
125 が相対パスで、かつ
126 .I dirfd
127 がディレクトリ以外のファイルを参照するファイルディスクリプタである。
128 .TP
129 .B ENOTSUP
130 .I flags
131 にサポートされていない値
132 .B AT_SYMLINK_NOFOLLOW
133
134 指定された。
135 .SH バージョン
136 .BR fchmodat ()
137 は Linux カーネル 2.6.16 で追加された。
138 .SH 準拠
139 POSIX.1-2008.
140 .SH 注意
141 .BR fchmodat ()
142 が必要な理由については、
143 .BR openat (2)
144 を参照すること。
145 .SH 関連項目
146 .BR chmod (2),
147 .BR openat (2),
148 .BR path_resolution (7),
149 .BR symlink (7)