Perhaps most interesting is the POSIX specification, which state that both fsync() and fdatasync() should return EBADF when passed an invalid file descriptor not open for writing.
See <URL: http://pubs.opengroup.org/onlinepubs/009695399/functions/fsync.html > and <URL: http://pubs.opengroup.org/onlinepubs/009695399/functions/fdatasync.html >. This make me believe libeatmydata should change to behave according to the POSIX specification. -- Happy hacking Petter Reinholdtsen

