OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man2 / renameat.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 RENAMEAT 2 2009\-12\-13 Linux "Linux Programmer's Manual"
32 .SH 名前
33 renameat \- ディレクトリファイルディスクリプタから相対的な位置にあるファイルの名前を変更する
34 .SH 書式
35 .nf
36 \fB#include <fcntl.h> /* AT_* 定数の定義 */\fP
37 \fB#include <stdio.h>\fP
38 .sp
39 \fBint renameat(int \fP\fIolddirfd\fP\fB, const char *\fP\fIoldpath\fP\fB,\fP
40 \fB             int \fP\fInewdirfd\fP\fB, const char *\fP\fInewpath\fP\fB);\fP
41 .fi
42 .sp
43 .in -4n
44 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
45 .in
46 .sp
47 \fBrenameat\fP():
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 \fBrenameat\fP()  システムコールは、この man ページで説明している違いがある以外は、 \fBrename\fP(2)
62 と全く同じように動作する。
63
64 \fIoldpath\fP で指定されるパス名が相対パスである場合、 ファイルディスクリプタ \fIolddirfd\fP
65 で参照されるディレクトリからの相対パス名として解釈される (\fBrename\fP(2)
66 では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの 相対パスとなる)。
67
68 \fIoldpath\fP が相対パスであり、かつ \fIolddirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIoldpath\fP は
69 (\fBrename\fP(2)  と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。
70
71 \fIoldpath\fP が絶対パスである場合、 \fIolddirfd\fP は無視される。
72
73 \fInewpath\fP の解釈は \fIoldpath\fP と同様であるが、 相対パス名はファイルディスクリプタ \fInewdirfd\fP
74 で参照されるディレクトリからの相対パス名として解釈される。
75 .SH 返り値
76 成功した場合、 \fBrenameat\fP()  は 0 を返す。 エラーの場合、\-1 が返されて、 \fIerrno\fP にはエラーを示す値が設定される。
77 .SH エラー
78 \fBrename\fP(2)  と同じエラーが \fBrenameat\fP()  でも起こる。 \fBrenameat\fP()
79 では、その他に以下のエラーが起こる:
80 .TP 
81 \fBEBADF\fP
82 \fIolddirfd\fP または \fInewdirfd\fP が有効なファイルディスクリプタでない。
83 .TP 
84 \fBENOTDIR\fP
85 \fIoldpath\fP が相対パスで、かつ \fIolddirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。 または
86 \fInewpath\fP と \fInewdirfd\fP について、同様のことが起きている。
87 .SH バージョン
88 \fBrenameat\fP()  は Linux カーネル 2.6.16 で追加された。
89 .SH 準拠
90 POSIX.1\-2008.
91 .SH 注意
92 \fBrenameat\fP()  が必要な理由については、 \fBopenat\fP(2)  を参照すること。
93 .SH 関連項目
94 \fBopenat\fP(2), \fBrename\fP(2), \fBpath_resolution\fP(7)