Make use of F_BARRIERFSYNC as an alternative to F_FULLFSYNC when it is available.

FossilOrigin-Name: 3c517ba5dc386c7782c90536ce67562d7d6d2f155203a09b57b1f8f655c1b958
This commit is contained in:
drh 2023-04-21 13:53:13 -05:00 committed by Max Radermacher
parent c00c9c8238
commit cded2fc025

View File

@ -3674,7 +3674,14 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
}
#elif HAVE_FULLFSYNC
if( fullSync ){
#ifdef F_BARRIERFSYNC
rc = osFcntl(fd, F_BARRIERFSYNC, 0);
if( rc && errno==ENOTSUP ){
rc = osFcntl(fd, F_FULLFSYNC, 0);
}
#else
rc = osFcntl(fd, F_FULLFSYNC, 0);
#endif
}else{
rc = 1;
}