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>