OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man2 / unlinkat.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 .\"
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .TH UNLINKAT 2 2012\-03\-25 Linux "Linux Programmer's Manual"
32 .SH 名前
33 unlinkat \- ディレクトリファイルディスクリプタから相対的な位置にあるディレクトリエントリを削除する
34 .SH 書式
35 .nf
36 \fB#include <fcntl.h> /* AT_* 定数の定義 */\fP
37 \fB#include <unistd.h>\fP
38 .sp
39 \fBint unlinkat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, int \fP\fIflags\fP\fB);\fP
40 .fi
41 .sp
42 .in -4n
43 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
44 .in
45 .sp
46 \fBunlinkat\fP():
47 .PD 0
48 .ad l
49 .RS 4
50 .TP  4
51 glibc 2.10 以降:
52 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
53 .TP 
54 glibc 2.10 より前:
55 _ATFILE_SOURCE
56 .RE
57 .ad
58 .PD
59 .SH 説明
60 \fBunlinkat\fP()  システムコールは、この man ページで説明している違いがある以外は、 (\fIflags\fP に
61 \fBAT_REMOVEDIR\fP フラグが含まれるか否かにより)  \fBunlink\fP(2)  または \fBrmdir\fP(2)
62 と全く同じように動作する。
63
64 \fIpathname\fP で指定されるパス名が相対パス名である場合、 ファイルディスクリプタ \fIdirfd\fP
65 で参照されるディレクトリからの相対パス名として解釈される (\fBunlink\fP(2)  または \fBrmdir\fP(2)
66 では、相対パスは呼び出し元プロセスの カレントワーキングディレクトリからの相対パスとなる)。
67
68 \fIpathname\fP で指定されるパス名が相対パス名であり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、
69 \fIpathname\fP は (\fBunlink\fP(2)  または \fBrmdir\fP(2)  と同じように) 呼び出し元プロセスの
70 カレントワーキングディレクトリからの相対パス名として解釈される。
71
72 \fIpathname\fP で指定されるパス名が絶対パス名である場合、 \fIdirfd\fP は無視される。
73
74 \fIflags\fP はビットマスクであり、0 または \fBunlinkat\fP()  の操作を制御するフラグ値の OR を指定できる。 現在のところ 1
75 つのフラグだけが定義されている:
76 .TP 
77 \fBAT_REMOVEDIR\fP
78 デフォルトでは、 \fBunlinkat\fP()  は \fIpathname\fP に対して \fBunlink\fP(2)  と同じ操作を行う。
79 \fBAT_REMOVEDIR\fP フラグが指定されると、 \fIpathname\fP に対して \fBrmdir\fP(2)  と同じ操作を行う。
80 .SH 返り値
81 成功した場合、 \fBunlinkat\fP()  は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。
82 .SH エラー
83 \fBunlink\fP(2)  または \fBrmdir\fP(2)  と同じエラーが \fBunlinkat\fP()  でも起こる。 \fBunlinkat\fP()
84 では、その他に以下のエラーが起こる:
85 .TP 
86 \fBEBADF\fP
87 \fIdirfd\fP が有効なファイルディスクリプタでない。
88 .TP 
89 \fBEINVAL\fP
90 \fIflags\fP に不正なフラグ値が指定された。
91 .TP 
92 \fBENOTDIR\fP
93 \fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。
94 .SH バージョン
95 \fBunlinkat\fP()  は Linux カーネル 2.6.16 で追加された。
96 .SH 準拠
97 POSIX.1\-2008.  Solaris には、これと同じようなシステムコールが存在する。
98 .SH 注意
99 \fBunlinkat\fP()  が必要な理由については、 \fBopenat\fP(2)  を参照すること。
100 .SH 関連項目
101 \fBopenat\fP(2), \fBrmdir\fP(2), \fBunlink\fP(2), \fBpath_resolution\fP(7)