Skip to content

Commit 7cc96cc

Browse files
committed
unix: Include fdatasync(2) on non-Apple systems
The function is defined in POSIX [0], but according to Gnulib docs [1], it is missing or not declared on at least some versions of OS X. On Solaris, it is not a system call but is present as fdatasync(3) [2]. [0] http://www.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html [1] https://www.gnu.org/software/gnulib/manual/html_node/fdatasync.html [2] http://docs.oracle.com/cd/E36784_01/html/E36874/fdatasync-3c.html
1 parent 5f527b0 commit 7cc96cc

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ extern {
593593
timeout: *const ::timespec) -> ::c_int;
594594
pub fn sigwaitinfo(set: *const sigset_t,
595595
info: *mut siginfo_t) -> ::c_int;
596+
pub fn fdatasync(fd: ::c_int) -> ::c_int;
596597
}
597598

598599
cfg_if! {

src/unix/bsd/openbsdlike/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ extern {
388388
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
389389
pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
390390
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
391+
pub fn fdatasync(fd: ::c_int) -> ::c_int;
391392
}
392393

393394
cfg_if! {

src/unix/solaris/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,5 +765,6 @@ extern {
765765
buf: *mut ::c_char,
766766
buflen: ::size_t) -> *const passwd;
767767
pub fn readdir(dirp: *mut ::DIR) -> *const ::dirent;
768+
pub fn fdatasync(fd: ::c_int) -> ::c_int;
768769
}
769770

0 commit comments

Comments
 (0)