As suggested by Roland McGrath, I'm opening a request regarding the aio_fsync() function returning EBADF when using a file descriptor not "open for writing". This is actually a minor inconsistency fixed POSIX: <http://austingroupbugs.net/view.php?id=671> The suggested change is not to check anymore the file descriptor flags.
Created attachment 6977 [details] Suggested patch for sysdeps/pthread/aio_fsync.c This is a suggested patch for the sysdeps/pthread/aio_fsync.c file. It just replaces the O_RDONLY flag check by a F_GETFL fd check (to ensure the file descriptor is valid) to accommodate the new specification.
Created attachment 6978 [details] Suggested patch for manual/llio.texi Suggested patch for the manual.
Please see also: * the related discussion on austin-group-l http://comments.gmane.org/gmane.comp.standards.posix.austin.general/6952 * the libc-alpha@sourceware.org discussion: http://sourceware.org/ml/libc-alpha/2013-04/msg00213.html
Fixed on trunk.