OSDN Git Service

4de34ffc1acef68b51fe3456ceaf0df701fac302
[linuxjm/LDP_man-pages.git] / draft / man3 / posix_fallocate.3
1 .\" Copyright (c) 2006, Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH POSIX_FALLOCATE 3 2013\-02\-12 GNU "Linux Programmer's Manual"
31 .SH 名前
32 posix_fallocate \- ファイルのスペースを確保する
33 .SH 書式
34 .nf
35 \fB#include <fcntl.h>\fP
36 .sp
37 \fBint posix_fallocate(int \fP\fIfd\fP\fB, off_t \fP\fIoffset\fP\fB, off_t \fP\fIlen\fP\fB);\fP
38 .fi
39 .sp
40 .ad l
41 .in -4n
42 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
43 .in
44 .sp
45 \fBposix_fallocate\fP():
46 .RS 4
47 _XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L
48 .RE
49 .ad
50 .SH 説明
51 関数 \fBposix_fallocate\fP()  は、ディスクリプタ \fIfd\fP で参照されるファイルに対して、ディスクスペースを確実に確保する。
52 ディスクスペースは \fIoffset\fP から始まる \fIlen\fP バイトの範囲のバイトである。 \fBposix_fallocate\fP()
53 の呼び出しが成功した後、指定された範囲のバイトに対する書き込みは、 ディスクスペースの不足で失敗しないことが保証される。
54
55 ファイルのサイズが \fIoffset\fP+\fIlen\fP より小さい場合、ファイルはこのサイズになるように拡大される。
56 それ以外の場合、ファイルサイズは変わらない。
57 .SH 返り値
58 \fBposix_fallocate\fP()  は成功した場合、0 を返す。 失敗した場合、エラー番号を返す。 \fIerrno\fP
59 が設定されない点に注意すること。
60 .SH エラー
61 .TP 
62 \fBEBADF\fP
63 \fIfd\fP が有効なファイルディスクリプタでないか、 書き込み用としてオープンされていない。
64 .TP 
65 \fBEFBIG\fP
66 \fIoffset+len\fP が最大ファイルサイズを超えている。
67 .TP 
68 \fBEINVAL\fP
69 \fIoffset\fP が 0 未満だったか、 \fIlen\fP が 0 以下だった。
70 .TP 
71 \fBENODEV\fP
72 \fIfd\fP が通常のファイルとして参照されていない。
73 .TP 
74 \fBENOSPC\fP
75 \fIfd\fP が参照するファイルを含むデバイスに十分な空き領域がない。
76 .TP 
77 \fBESPIPE\fP
78 \fIfd\fP がパイプを参照している。
79 .SH バージョン
80 \fBposix_fallocate\fP()  は glibc 2.1.94 以降で利用可能である。
81 .SH 準拠
82 POSIX.1\-2001.
83
84 POSIX.1\-2008 では、 \fIlen\fP が 0 の場合、もしくは \fIoffset\fP が 0 未満の場合、 \fBEINVAL\fP
85 エラーを返すものとされている。 POSIX.1\-2001 では、 \fIlen\fP が 0 未満の場合、もしくは \fIoffset\fP が 0 未満の場合、
86 \fBEINVAL\fP エラーを返すものとされている。また、 \fIlen\fP が 0 の場合、 \fBEINVAL\fP エラーを返してもよいとされている。
87 .SH 関連項目
88 \fBfallocate\fP(1), \fBfallocate\fP(2), \fBlseek\fP(2), \fBposix_fadvise\fP(2)
89 .SH この文書について
90 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
91 である。プロジェクトの説明とバグ報告に関する情報は
92 http://www.kernel.org/doc/man\-pages/ に書かれている。