From ba9830cfc9fe39c1720715176c0804606d2ea251 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 27 Feb 2012 13:23:06 +1300 Subject: [PATCH] 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 Signed-off-by: Michael Kerrisk --- man2/fsync.2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/man2/fsync.2 b/man2/fsync.2 index c20e34e42..8416eae16 100644 --- a/man2/fsync.2 +++ b/man2/fsync.2 @@ -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