.\" 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. .\" .\" Japanese Version Copyright (c) 2006 Yuichi SATO .\" all rights reserved. .\" Translated 2006-07-13, Yuichi SATO . LDP v2.29 .\" Updated 2010-04-11, Akihiro MOTOKI , LDP v3.24 .\" .TH POSIX_FALLOCATE 3 2010-09-20 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O posix_fallocate \- allocate file space posix_fallocate \- ファイルのスペースを確保する .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "int posix_fallocate(int " fd ", off_t " offset ", off_t " len ); .fi .sp .ad l .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .BR posix_fallocate (): .RS 4 _XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L .RE .ad .\"O .SH DESCRIPTION .SH 説明 .\"O The function .\"O .BR posix_fallocate () .\"O ensures that disk space is allocated for the file referred to by the .\"O descriptor .\"O .I fd .\"O for the bytes in the range starting at .\"O .I offset .\"O and continuing for .\"O .I len .\"O bytes. 関数 .BR posix_fallocate () は、ディスクリプタ .I fd で参照されるファイルに対して、ディスクスペースを確実に確保する。 ディスクスペースは .I offset から始まる .I len バイトの範囲のバイトである。 .\"O After a successful call to .\"O .BR posix_fallocate (), .\"O subsequent writes to bytes in the specified range are .\"O guaranteed not to fail because of lack of disk space. .BR posix_fallocate () の呼び出しが成功した後、指定された範囲のバイトに対する書き込みは、 ディスクスペースの不足で失敗しないことが保証される。 .\"O If the size of the file is less than .\"O .IR offset + len , .\"O then the file is increased to this size; .\"O otherwise the file size is left unchanged. ファイルのサイズが .IR offset + len より小さい場合、ファイルはこのサイズになるように拡大される。 それ以外の場合、ファイルサイズは変わらない。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O .BR posix_fallocate () .\"O returns zero on success, or an error number on failure. .BR posix_fallocate () は成功した場合、0 を返す。 失敗した場合、エラー番号を返す。 .\"O Note that .\"O .I errno .\"O is not set. .I errno が設定されない点に注意すること。 .\"O .SH "ERRORS" .SH エラー .TP .B EBADF .\"O .I fd .\"O is not a valid file descriptor, or is not opened for writing. .I fd が有効なディスクリプタでない。 または書き込み用にオープンされていない。 .TP .B EFBIG .\"O .I offset+len .\"O exceeds the maximum file size. .I offset+len が最大ファイルサイズを超えている。 .TP .B EINVAL .\"O .I offset .\"O was less than 0, or .\"O .I len .\"O was less than or equal to 0. .I offset が 0 未満だったか、 .I len が 0 以下だった。 .TP .B ENODEV .\"O .I fd .\"O does not refer to a regular file. .I fd が通常のファイルとして参照されていない。 .TP .B ENOSPC .\"O There is not enough space left on the device containing the file .\"O referred to by .\"O .IR fd . .I fd で参照されるファイルが存在するデバイスに、十分なスペースが残っていない。 .TP .B ESPIPE .\"O .I fd .\"O refers to a pipe of file descriptor. .I fd がファイルディスクリプタのパイプを参照している。 .\"O .SH VERSIONS .SH バージョン .\"O .BR posix_fallocate () .\"O is available since glibc 2.1.94. .BR posix_fallocate () は glibc 2.1.94 以降で利用可能である。 .\"O .SH "CONFORMING TO" .SH 準拠 POSIX.1-2001. .\"O POSIX.1-2008 says that an implementation .\"O .I shall .\"O give the .\"O .B EINVAL .\"O error if .\"O .I len .\"O was 0, or .\"O .I offset .\"O was less than 0. POSIX.1-2008 では、 .I len が 0 の場合、もしくは .I offset が 0 未満の場合、 .B EINVAL エラーを返すものとされている。 .\"O POSIX.1-2001 says that an implementation .\"O .I shall .\"O give the .\"O .B EINVAL .\"O error if .\"O .I len .\"O is less than 0, or .\"O .I offset .\"O was less than 0, and .\"O .I may .\"O give the error if .\"O .I len .\"O equals zero. POSIX.1-2001 では、 .I len が 0 未満の場合、もしくは .I offset が 0 未満の場合、 .B EINVAL エラーを返すものとされている。また、 .I len が 0 の場合、 .B EINVAL エラーを返してもよいとされている。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR fallocate (2), .BR lseek (2), .BR posix_fadvise (2)