Skip to content

Commit f179b86

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 f179b86

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-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/notbsd/linux/musl/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ extern {
159159
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
160160
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
161161
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
162+
pub fn openpty(amaster: *mut ::c_int,
163+
aslave: *mut ::c_int,
164+
name: *mut ::c_char,
165+
termp: *mut termios,
166+
winp: *mut ::winsize) -> ::c_int;
162167
}
163168

164169
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)