Skip to content

Commit 25547c6

Browse files
kkebokateinoigakukun
authored andcommitted
WASI: Use fcntl(fd, F_FULLFSYNC) instead of fsync(fd) on Darwin
1 parent 76dedad commit 25547c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/SystemExtras/FileOperations.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,11 @@ extension FileDescriptor {
587587
return .failure(Errno(rawValue: ERROR_NOT_SUPPORTED))
588588
#else
589589
nothingOrErrno(retryOnInterrupt: false) {
590+
#if SYSTEM_PACKAGE_DARWIN
591+
system_fcntl(self.rawValue, F_FULLFSYNC)
592+
#else
590593
system_fsync(self.rawValue)
594+
#endif
591595
}
592596
#endif
593597
}

0 commit comments

Comments
 (0)