summaryrefslogtreecommitdiff
path: root/modules/fdatasync
Commit message (Collapse)AuthorAgeFilesLines
* fdatasync: port to SolarisEric Blake2011-09-161-0/+3
| | | | | | | | | | Cater to Solaris requiring extra libraries for fdatasync. * m4/fdatasync.m4 (gl_FUNC_FDATASYNC): Set LIB_FDATASYNC. * modules/fdatasync (Link): Document it. * modules/fdatasync-tests (test_fdatasync_LDADD): Link with it. Signed-off-by: Eric Blake <eblake@redhat.com>
* fdatasync: minor improvementsEric Blake2011-09-161-1/+1
| | | | | | | | | | | Picks up some ideas by Paul Eggert from here: https://lists.gnu.org/archive/html/bug-coreutils/2011-07/msg00157.html * modules/fdatasync (Depends-on): Add condition for fsync. * lib/fdatasync.c (fdatasync): Add comment. * tests/test-unistd-c++.cc: Test fdatasync. Signed-off-by: Eric Blake <eblake@redhat.com>
* fdatasync: new moduleEric Blake2011-09-161-0/+28
At least libvirt would like to use the lighter-weight fdatasync on platforms where it is supported, while still guaranteeing full sync (via the heavy-weight fsync fallback) on all platforms. I've got an open question to the Austin Group, since the POSIX 2008 wording is self-contradictory (unlike fsync, fdatasync requires EBADF on non-writable fds, but still mentions that read() errors must be propagated). I can see how fsync() would affect atime after read() while fdatasync() can skip that, explaining why fdatasync() might have the EBADF requirement, but on the other hand, that prevents an implementation (like ours) where fdatasync is a straight alias of fsync. At any rate, glibc allows fdatasync on read-only fds. * modules/fsync (Description): Document difference to fdatasync. * modules/fdatasync: New module. * m4/fdatasync.m4 (gl_FUNC_FDATASYNC): New file. * lib/fdatasync.c (fdatasync): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H, gl_UNISTD_H_DEFAULTS): Set up defaults. * modules/unistd (Makefile.am): Set witnesses. * lib/unistd.in.h (fdatasync): Declare. * MODULES.html.sh: Document it. * doc/posix-functions/fdatasync.texi (fdatasync): Likewise. * modules/fdatasync-tests: New test. * tests/test-fdatasync.c: Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>