Skip to content

Commit aab4d11

Browse files
committed
Move FreeBSD-only function into freebsd/mod.rs
1 parent 9921f03 commit aab4d11

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,11 @@ pub const POSIX_FADV_NOREUSE: ::c_int = 5;
7070

7171
extern {
7272
pub fn __error() -> *mut ::c_int;
73+
74+
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
75+
len: ::off_t) -> ::c_int;
76+
pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t,
77+
advise: ::c_int) -> ::c_int;
78+
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
79+
pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
7380
}

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,6 @@ extern {
590590
pub fn clock_gettime(clk_id: ::uint64_t, tp: *mut ::timespec) -> ::c_int;
591591

592592
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
593-
#[cfg(not(target_os = "dragonfly"))]
594-
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
595-
len: ::off_t) -> ::c_int;
596593
pub fn sched_setscheduler(pid: ::pid_t, policy: ::c_int, param: *const sched_param) -> ::c_int;
597594
pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
598595
pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
@@ -603,14 +600,6 @@ extern {
603600
hdtr: *mut ::sf_hdtr,
604601
sbytes: *mut ::off_t,
605602
flags: ::c_int) -> ::c_int;
606-
607-
#[cfg(not(target_os = "dragonfly"))]
608-
pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t,
609-
advise: ::c_int) -> ::c_int;
610-
#[cfg(not(target_os = "dragonfly"))]
611-
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
612-
#[cfg(not(target_os = "dragonfly"))]
613-
pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
614603
}
615604

616605
cfg_if! {

0 commit comments

Comments
 (0)