Skip to content

Commit

Permalink
unix: Include fdatasync(2) on non-Apple systems
Browse files Browse the repository at this point in the history
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 and
FreeBSD. 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
  • Loading branch information
kamalmarhubi committed Mar 6, 2016
1 parent 5f527b0 commit a3d4884
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/unix/bsd/openbsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ extern {
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
}

cfg_if! {
Expand Down
1 change: 1 addition & 0 deletions src/unix/solaris/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,5 +765,6 @@ extern {
buf: *mut ::c_char,
buflen: ::size_t) -> *const passwd;
pub fn readdir(dirp: *mut ::DIR) -> *const ::dirent;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
}

0 comments on commit a3d4884

Please sign in to comment.