Guillem, On Sun, Jan 1, 2012 at 3:49 PM, Guillem Jover <guillem@xxxxxxxxxxx> wrote: > Hi! > > On 2011-11-04 6:12:04, Christoph Hellwig wrote: >> - fsync works on any fd and does not require a writeable one, >> correct the EBADF error code explanation. > > The problem is, while this is true for Linux, that's not a safe portable > assumption to make on POSIX in general as that behaviour is not > specified and as such is implementation specific, some Unix systems > do actually fail on read-only file descriptors, for example: > > <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V50_HTML/MAN/MAN2/0033____.HTM> > <http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/fsync.htm> > > So if this part of the patch gets applied it would be nice to add a > note stating this is Linux specific behaviour, and that other systems > might still fail on such condition. Good catch! I applied the patch below. Cheers, Michael --- 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 -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html