Add support for macOS fcntl(F_FULLFSYNC) (closes #6)
On macOS, replace fcntl syscall, check if its called for F_FULLFSYNC,
and make it a no-op. Add a new test fcntltest.c, verify with dtruss
that F_FULLFSYNC does not happen.
At the same time add missing entries to .gitignore, and mark
sync_file_range as LIBEATMYDATA_API
[stewart: remove pthread_testcancel() in fctl() path, fcntl should already handle it]
This brings macOS support to the level of fully passing testsuite,
including verification with dtruss (an strace-like tool) that no *sync
syscalls are executed.
- macOS pthreads do not have pthread barriers. Add autoconf tests for
pthread.h and pthread_barrier_t, and exclude test/tst-cancel4 from
build if barriers are not present.
- macOS does not have open64 library function. Add autoconf test, and
do not attempt to replace it if it does not exist.
- Extend ASSIGN_DLSYM_OR_DIE macro to print diagnostics to stderr in
the case of dlsym failure.
- Factor out the macOS fdatasync declaration - where the function
exists without a prototype - to a new header portability.h, fix its
conditional compilation, include in all fdatasync-using files.
- Fix test-run.sh to work with macOS dynamic library preload scheme,
add a new helper script start_suspended.sh to support it.
This was causing an issue with the MySQL 5.7.17 unit tests.
Namely, the overridden libc functions weren't checking file descriptor
validity, and if a caller *expected* to fail with EBADF rather than return
success, the caller would be rather disappointed.