-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 3/13/2013 10:02 AM, Eric Blake wrote: > There may be no syncing action, but it is still reasonable to > ensure that the fd is still valid enough to be sync'd. It's a > single fcntl() call to prove whether an fd is valid.
Yes, but why? Why does gnulib care? I can't imagine any application in its right mind relying on getting EBADF for correct operation, so why is gnulib asserting that this happens? >> Why does gnulib care that it fails when used wrongly? > > Because POSIX mandates an EBADF error, and your LD_PRELOAD should > not be breaking those semantics. It also mandates that it not return until the data is on disk. The whole point of the library is to violate posix, without letting applications know. Is gnulib also going to do an O_DIRECT read after fsync to assert that the data hit the disk before it returned? How pedantic are we going to get here? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRQI3IAAoJEJrBOlT6nu75OG0IAITdFlxLqdi+NAzV1MsQNhIp i3xqDe6iVuSTM257pubJdcrAxZ+/psflH6LR67rN0fSlKnhSoo+ZZaVHkTXYGtCV wEA7MwJ9guPaKorXmtAaqA0BhaC9LfwifRjI0eKILh/P0YYNRwznUCCcWPCGZBVe e4OSuNrjLhywADicT+IaOpDvHB7P8Blpk6tFe7xxqP+bLu3+EHRSQp2jMVvXn8ii vGLjvg3Tkf3AVGoUVH6htJ4VtxaPAt55c/QifD1YNXcMlRZAyF42wblipbO5azJ/ dREdMgU2/iUKri19So1RnBfkcMfmzTfpRsqhRfytyw5QfHKYvKltjoC0Z5szg1s= =fQx7 -----END PGP SIGNATURE-----