utils: FreeBSD supports fdatasync(2)
FreeBSD supports fdatasync(2). Enable it in os_unix.c. Signed-off-by: Cy Schubert <cy@FreeBSD.org>
This commit is contained in:
parent
9bd9434108
commit
362d9a49d4
1 changed files with 2 additions and 2 deletions
|
@ -464,9 +464,9 @@ int os_file_exists(const char *fname)
|
||||||
int os_fdatasync(FILE *stream)
|
int os_fdatasync(FILE *stream)
|
||||||
{
|
{
|
||||||
if (!fflush(stream)) {
|
if (!fflush(stream)) {
|
||||||
#ifdef __linux__
|
#if defined __FreeBSD__ || defined __linux__
|
||||||
return fdatasync(fileno(stream));
|
return fdatasync(fileno(stream));
|
||||||
#else /* !__linux__ */
|
#else /* !__linux__ && !__FreeBSD__ */
|
||||||
#ifdef F_FULLFSYNC
|
#ifdef F_FULLFSYNC
|
||||||
/* OS X does not implement fdatasync(). */
|
/* OS X does not implement fdatasync(). */
|
||||||
return fcntl(fileno(stream), F_FULLFSYNC);
|
return fcntl(fileno(stream), F_FULLFSYNC);
|
||||||
|
|
Loading…
Reference in a new issue