Skip to content

Commit 7204754

Browse files
committed
netbsd: Cleanup to make the module more similar to libc-0.2
1 parent f508b33 commit 7204754

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,8 +1676,7 @@ cfg_if! {
16761676
}
16771677
impl Eq for semun {}
16781678
impl ::fmt::Debug for semun {
1679-
fn fmt(&self, f: &mut ::fmt::Formatter)
1680-
-> ::fmt::Result {
1679+
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
16811680
f.debug_struct("semun")
16821681
.field("val", unsafe { &self.val })
16831682
.finish()

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2893,6 +2893,9 @@ extern "C" {
28932893
ntargets: ::size_t,
28942894
hint: *const ::c_void,
28952895
) -> ::c_int;
2896+
2897+
pub fn getmntinfo(mntbufp: *mut *mut ::statvfs, flags: ::c_int) -> ::c_int;
2898+
pub fn getvfsstat(buf: *mut statvfs, bufsize: ::size_t, flags: ::c_int) -> ::c_int;
28962899
}
28972900

28982901
#[link(name = "rt")]
@@ -3118,11 +3121,6 @@ extern "C" {
31183121
) -> ::c_int;
31193122
}
31203123

3121-
extern "C" {
3122-
pub fn getmntinfo(mntbufp: *mut *mut ::statvfs, flags: ::c_int) -> ::c_int;
3123-
pub fn getvfsstat(buf: *mut statvfs, bufsize: ::size_t, flags: ::c_int) -> ::c_int;
3124-
}
3125-
31263124
cfg_if! {
31273125
if #[cfg(target_arch = "aarch64")] {
31283126
mod aarch64;

src/unix/bsd/netbsdlike/openbsd/mod.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,6 +2166,11 @@ extern "C" {
21662166
pub fn mimmutable(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
21672167

21682168
pub fn reboot(mode: ::c_int) -> ::c_int;
2169+
2170+
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
2171+
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
2172+
pub fn getmntinfo(mntbufp: *mut *mut ::statfs, flags: ::c_int) -> ::c_int;
2173+
pub fn getfsstat(buf: *mut statfs, bufsize: ::size_t, flags: ::c_int) -> ::c_int;
21692174
}
21702175

21712176
#[link(name = "execinfo")]
@@ -2184,13 +2189,6 @@ extern "C" {
21842189
) -> *mut *mut ::c_char;
21852190
}
21862191

2187-
extern "C" {
2188-
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
2189-
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
2190-
pub fn getmntinfo(mntbufp: *mut *mut ::statfs, flags: ::c_int) -> ::c_int;
2191-
pub fn getfsstat(buf: *mut statfs, bufsize: ::size_t, flags: ::c_int) -> ::c_int;
2192-
}
2193-
21942192
cfg_if! {
21952193
if #[cfg(target_arch = "aarch64")] {
21962194
mod aarch64;

0 commit comments

Comments
 (0)