fsync.2: Note that some systems require a writable file descriptor

An edited version of Guillem Jover's comments:
[While the file descriptor does not need to be writable on Linux]
that's not a safe portable assumption to make on POSIX in general
as that behavior is not specified and as such is
implementation-specific. Some Unix systems do actually fail on
read-only file descriptors, for example [HP-UX and AIX].

Reported-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2012-02-27 13:23:06 +13:00
parent ad4760331e
commit ba9830cfc9
1 changed files with 6 additions and 0 deletions

View File

@ -139,6 +139,12 @@ to a value greater than 0.
.\" -1: unavailable, 0: ask using sysconf().
.\" glibc defines them to 1.
.SH NOTES
On some UNIX systems (but not Linux),
.I fd
must be a
.I writable
file descriptor.
In Linux 2.2 and earlier,
.BR fdatasync ()
is equivalent to