Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/new/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ cfg_if! {
if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
pub use signal::*;
pub use sys::socket::*;
pub use sys::statfs::*;
pub use sys::statvfs::*;
}
}

Expand Down
21 changes: 21 additions & 0 deletions src/new/musl/arch/mips/bits/statfs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use crate::prelude::*;

// FIXME(1.0,deprecate): lfs binding to be removed
pub type statfs64 = statfs;

s! {
pub struct statfs {
pub f_type: c_ulong,
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_ulong,
pub f_flags: c_ulong,
f_spare: Padding<[c_ulong; 5]>,
}
}
1 change: 1 addition & 0 deletions src/new/musl/arch/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

pub(crate) mod bits {
pub(crate) mod socket;
pub(crate) mod statfs;
}
21 changes: 21 additions & 0 deletions src/new/musl/arch/mips64/bits/statfs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use crate::prelude::*;

// FIXME(1.0,deprecate): lfs binding to be removed
pub type statfs64 = statfs;

s! {
pub struct statfs {
pub f_type: c_ulong,
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_ulong,
pub f_flags: c_ulong,
f_spare: Padding<[c_ulong; 5]>,
}
}
1 change: 1 addition & 0 deletions src/new/musl/arch/mips64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

pub(crate) mod bits {
pub(crate) mod socket;
pub(crate) mod statfs;
}
2 changes: 2 additions & 0 deletions src/new/musl/arch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ pub(crate) mod generic;
pub(crate) mod mips;
#[cfg(target_arch = "mips64")]
pub(crate) mod mips64;
#[cfg(target_arch = "s390x")]
pub(crate) mod s390x;
21 changes: 21 additions & 0 deletions src/new/musl/arch/s390x/bits/statfs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use crate::prelude::*;

// FIXME(1.0,deprecate): lfs binding to be removed
pub type statfs64 = statfs;

s! {
pub struct statfs {
pub f_type: c_uint,
pub f_bsize: c_uint,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_uint,
pub f_frsize: c_uint,
pub f_flags: c_uint,
f_spare: Padding<[c_uint; 4]>,
}
}
8 changes: 8 additions & 0 deletions src/new/musl/arch/s390x/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//! Source directory: `arch/s390x/`
//!
//! * Headers: <https://git.musl-libc.org/cgit/musl/tree/arch/s390x> (official)
//! * Headers: <https://github.com/kraj/musl/tree/master/arch/s390x> (mirror)

pub(crate) mod bits {
pub(crate) mod statfs;
}
14 changes: 12 additions & 2 deletions src/new/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ mod arch;
pub(crate) mod bits {
cfg_if! {
if #[cfg(target_arch = "mips")] {
pub(crate) use super::arch::mips::bits::socket;
pub(crate) use super::arch::mips::bits::{
socket,
statfs,
};
} else if #[cfg(target_arch = "mips64")] {
pub(crate) use super::arch::mips64::bits::socket;
pub(crate) use super::arch::mips64::bits::{
socket,
statfs,
};
} else if #[cfg(target_arch = "s390x")] {
pub(crate) use super::arch::s390x::bits::statfs;
} else {
// Reexports from generic will live here once we need them.
}
Expand All @@ -28,6 +36,8 @@ pub(crate) mod pthread;
/// * Headers: <https://github.com/kraj/musl/tree/master/include/sys> (mirror)
pub(crate) mod sys {
pub(crate) mod socket;
pub(crate) mod statfs;
pub(crate) mod statvfs;
}

pub(crate) mod sched;
Expand Down
40 changes: 40 additions & 0 deletions src/new/musl/sys/statfs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//! Header: `sys/statfs.h`
//!
//! * Headers: <https://git.musl-libc.org/cgit/musl/blob/arch/include/sys/statfs.h> (official)
//! * Headers: <https://github.com/kraj/musl/blob/kraj/master/include/sys/statfs.h> (mirror)

cfg_if! {
// MIPS/s390x implementation is special (see arch folders)
if #[cfg(any(
target_arch = "mips",
target_arch = "mips64",
target_arch = "s390x"
))] {
pub use crate::bits::statfs::{
statfs,
statfs64,
};
} else {
use crate::prelude::*;

s! {
pub struct statfs {
pub f_type: c_ulong,
pub f_bsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_ulong,
pub f_frsize: c_ulong,
pub f_flags: c_ulong,
f_spare: Padding<[c_ulong; 4]>,
}
}

// FIXME(1.0,deprecate): lfs binding to be removed
pub type statfs64 = statfs;
}
}
31 changes: 31 additions & 0 deletions src/new/musl/sys/statvfs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//! Header: `sys/statvfs.h`
//!
//! * Headers: <https://git.musl-libc.org/cgit/musl/blob/arch/include/sys/statvfs.h> (official)
//! * Headers: <https://github.com/kraj/musl/blob/kraj/master/include/sys/statvfs.h> (mirror)

use crate::prelude::*;

s! {
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::fsfilcnt_t,
#[cfg(target_endian = "little")]
pub f_fsid: c_ulong,
#[cfg(target_pointer_width = "32")]
__pad: Padding<c_int>,
#[cfg(target_endian = "big")]
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_reserved: Padding<[c_int; 6]>,
}
}

// FIXME(1.0,deprecate): lfs binding to be removed
pub type statvfs64 = statvfs;
31 changes: 0 additions & 31 deletions src/unix/linux_like/linux/musl/b32/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,37 +122,6 @@ s! {
#[cfg(musl32_time64)]
pub shm_ctime: crate::time_t,
}

pub struct statfs {
pub f_type: c_ulong,
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_ulong,
pub f_flags: c_ulong,
f_spare: Padding<[c_ulong; 5]>,
}

// FIXME(1.0,deprecate): lfs binding to be removed
pub struct statfs64 {
pub f_type: c_ulong,
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_ulong,
pub f_flags: c_ulong,
f_spare: Padding<[c_ulong; 5]>,
}
}

cfg_if! {
Expand Down
31 changes: 0 additions & 31 deletions src/unix/linux_like/linux/musl/b64/mips64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,37 +71,6 @@ s! {
__unused1: Padding<c_ulong>,
__unused2: Padding<c_ulong>,
}

pub struct statfs {
pub f_type: c_ulong,
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_ulong,
pub f_flags: c_ulong,
f_spare: Padding<[c_ulong; 5]>,
}

// FIXME(1.0,deprecate): lfs binding to be removed
pub struct statfs64 {
pub f_type: c_ulong,
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt64_t,
pub f_bfree: crate::fsblkcnt64_t,
pub f_files: crate::fsfilcnt64_t,
pub f_ffree: crate::fsfilcnt64_t,
pub f_bavail: crate::fsblkcnt64_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_ulong,
pub f_flags: c_ulong,
f_spare: Padding<[c_ulong; 5]>,
}
}

pub const SIGSTKSZ: size_t = 8192;
Expand Down
18 changes: 0 additions & 18 deletions src/unix/linux_like/linux/musl/b64/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ pub type nlink_t = u64;
pub type wchar_t = i32;
pub type greg_t = u64;

// FIXME(1.0,deprecate): lfs binding to be removed
pub type statfs64 = statfs;

s! {
pub struct ipc_perm {
#[cfg(musl_v1_2)]
Expand Down Expand Up @@ -65,21 +62,6 @@ s! {
__unused: Padding<[c_long; 3]>,
}

pub struct statfs {
pub f_type: c_uint,
pub f_bsize: c_uint,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_uint,
pub f_frsize: c_uint,
pub f_flags: c_uint,
f_spare: Padding<[c_uint; 4]>,
}

pub struct __psw_t {
pub mask: c_ulong,
pub addr: c_ulong,
Expand Down
Loading
Loading