1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-27 08:52:26 +03:00

Another attempt to get fdatasync to be ignored on non-conforming posix systems.

Now a system has to opt-in for fdatasync instead of opt-out.
Ticket #1467. (CVS 2741)

FossilOrigin-Name: 115340d4e85f1bbbab657edbb504284343d86e2c
This commit is contained in:
drh
2005-10-05 10:29:36 +00:00
parent ff55c3585c
commit f2f23916ec
6 changed files with 24 additions and 25 deletions

View File

@@ -788,6 +788,14 @@ int sqlite3_sync_count = 0;
int sqlite3_fullsync_count = 0;
#endif
/*
** Use the fdatasync() API only if the HAVE_FDATASYNC macro is defined.
** Otherwise use fsync() in its place.
*/
#ifndef HAVE_FDATASYNC
# define fdatasync fsync
#endif
/*
** The fsync() system call does not work as advertised on many
@@ -829,12 +837,9 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
if( rc ) rc = fsync(fd);
#else /* if !defined(F_FULLSYNC) */
#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO>0
if( dataOnly ){
rc = fdatasync(fd);
}else
#endif /* _POSIX_SYNCHRONIZED_IO > 0 */
{
}else{
rc = fsync(fd);
}
#endif /* defined(F_FULLFSYNC) */