Expand text noting that ftruncate()/truncate() may fail

if asked to extend a file beyond its current length.
Add EPERM error.
This commit is contained in:
Michael Kerrisk 2006-05-09 05:28:41 +00:00
parent 42b099302d
commit 5b548b3131
1 changed files with 14 additions and 1 deletions

View File

@ -130,6 +130,12 @@ The named file does not exist.
.B ENOTDIR
A component of the path prefix is not a directory.
.TP
.B EPERM
.\" This happens for at leas MSDOS and VFAT fil systems
.\" on kernel 2.6.13
The underlying file system does not support extending
a file beyond its current size.
.TP
.B EROFS
The named file resides on a read-only file system.
.TP
@ -182,7 +188,14 @@ exceeds the file length
.BR truncate ()
is not specified at all in such an environment):
either returning an error, or extending the file.
(Most Unices follow the XSI requirement.)
Like most Unix implementations, Linux follows the XSI requirement
when dealing with native file systems.
However, some non-native file systems do not permit
.BR truncate ()
and
.BR ftruncate ()
to be used to extend a file beyond its current length:
a notable example on Linux is VFAT.
.\" At the very least: OSF/1, Solaris 7, and FreeBSD conform, mtk, Jan 2002
.SH "SEE ALSO"
.BR open (2),