Skip to content
Draft
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
103 changes: 25 additions & 78 deletions src/unix/linux_like/linux/uclibc/arm/mod.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
use crate::off64_t;
use crate::prelude::*;

pub type wchar_t = c_uint;
pub type time_t = c_long;

pub type clock_t = c_long;
pub type fsblkcnt_t = c_ulong;
pub type fsfilcnt_t = c_ulong;
pub type ino_t = c_ulong;
pub type off_t = c_long;
pub type pthread_t = c_ulong;
pub type suseconds_t = c_long;

pub type nlink_t = c_uint;
pub type blksize_t = c_long;
pub type blkcnt_t = c_long;

pub type statfs64 = statfs;
pub type stat64 = stat;

#[deprecated(
since = "0.2.187",
note = "Use `fsblkcnt_t` instead. The unsuffixed type is defined in terms of the suffixed type \
in default builds of upstream uclibc-ng, and the `libc` crate is itself phasing out \
support for suffixed variants in favor of a single fixed-width unsuffixed type."
)]
pub type fsblkcnt64_t = u64;
#[deprecated(
since = "0.2.187",
note = "Use `fsfilcnt_t` instead. The unsuffixed type is defined in terms of the suffixed type \
in default builds of upstream uclibc-ng, and the `libc` crate is itself phasing out \
support for suffixed variants in favor of a single fixed-width unsuffixed type."
)]
pub type fsfilcnt64_t = u64;
pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;
Expand All @@ -43,56 +52,25 @@ s! {
}

pub struct stat {
pub st_dev: c_ulonglong,
__pad1: Padding<c_ushort>,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: c_ulonglong,
__pad2: Padding<c_ushort>,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused4: Padding<c_ulong>,
__unused5: Padding<c_ulong>,
}

pub struct stat64 {
pub st_dev: c_ulonglong,
pub __pad1: c_uint,
pub st_dev: crate::dev_t,
__pad1: Padding<c_uint>,
pub __st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: c_ulonglong,
pub __pad2: c_uint,
pub st_size: off64_t,
pub st_rdev: crate::dev_t,
__pad2: Padding<c_uint>,
pub st_size: crate::off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_atime_nsec: c_ulong,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_mtime_nsec: c_ulong,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_ino: crate::ino64_t,
}

pub struct flock {
pub l_type: c_short,
pub l_whence: c_short,
pub l_start: off_t,
pub l_len: off_t,
pub l_pid: crate::pid_t,
pub st_ctime_nsec: c_ulong,
pub st_ino: crate::ino_t,
}

pub struct sysinfo {
Expand Down Expand Up @@ -128,37 +106,6 @@ s! {
pub f_spare: [c_int; 4],
}

pub struct statfs64 {
pub f_type: c_int,
pub f_bsize: c_int,
pub f_blocks: crate::fsblkcnt64_t,
pub f_bfree: crate::fsblkcnt64_t,
pub f_bavail: crate::fsblkcnt64_t,
pub f_files: crate::fsfilcnt64_t,
pub f_ffree: crate::fsfilcnt64_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_int,
pub f_frsize: c_int,
pub f_flags: c_int,
pub f_spare: [c_int; 4],
}

pub struct statvfs64 {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_favail: u64,
pub f_fsid: c_ulong,
__f_unused: Padding<c_int>,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}

pub struct sigset_t {
__val: [c_ulong; 2],
}
Expand Down
132 changes: 40 additions & 92 deletions src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
use crate::off64_t;
use crate::prelude::*;

pub type clock_t = i32;
pub type time_t = i32;
pub type suseconds_t = i32;
pub type wchar_t = i32;
pub type off_t = i32;
pub type ino_t = u32;
pub type blkcnt_t = i32;
pub type blksize_t = i32;
pub type nlink_t = u32;
pub type fsblkcnt_t = c_ulong;
pub type fsfilcnt_t = c_ulong;
pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;
#[deprecated(
since = "0.2.187",
note = "Use `fsblkcnt_t` instead. The unsuffixed type is defined in terms of the unsuffixed \
type in all default builds of upstream uClibc, and the `libc` crate is phasing out \
support for suffixed variants in favor of a single fixed-width suffixed variant."
)]
pub type fsblkcnt64_t = u64;
#[deprecated(
since = "0.2.187",
note = "Use `fsfilcnt_t` instead. The unsuffixed type is defined in terms of the unsuffixed \
type in all default builds of upstream uClibc, and the `libc` crate is phasing out \
support for suffixed variants in favor of a single fixed-width suffixed variant."
)]
pub type fsfilcnt64_t = u64;

pub type stat64 = stat;

s! {
pub struct stat {
pub st_dev: crate::dev_t,
Expand All @@ -27,59 +35,20 @@ s! {
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub st_pad2: [c_long; 1],
pub st_size: off_t,
st_pad3: Padding<c_long>,
st_pad2: [c_long; 2],
pub st_size: crate::off_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_atime_nsec: c_ulong,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_mtime_nsec: c_ulong,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_ctime_nsec: c_ulong,
pub st_blksize: crate::blksize_t,
st_pad4: Padding<c_long>,
pub st_blocks: crate::blkcnt_t,
st_pad5: Padding<[c_long; 14]>,
}

pub struct stat64 {
pub st_dev: crate::dev_t,
st_pad1: Padding<[c_long; 2]>,
pub st_ino: crate::ino64_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
st_pad2: Padding<[c_long; 2]>,
pub st_size: off64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_blksize: crate::blksize_t,
st_pad3: Padding<c_long>,
pub st_blocks: crate::blkcnt64_t,
st_pad5: Padding<[c_long; 14]>,
}

pub struct statvfs64 {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt64_t,
pub f_bfree: crate::fsblkcnt64_t,
pub f_bavail: crate::fsblkcnt64_t,
pub f_files: crate::fsfilcnt64_t,
pub f_ffree: crate::fsfilcnt64_t,
pub f_favail: crate::fsfilcnt64_t,
pub f_fsid: c_ulong,
pub __f_unused: c_int,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
pub __f_spare: [c_int; 6],
}

pub struct pthread_attr_t {
__size: [u32; 9],
}
Expand Down Expand Up @@ -108,6 +77,12 @@ s! {
pub _pad: [c_int; 29],
}

#[deprecated(
since = "0.2.187",
note = "Use `glob` instead. The suffixed variant exposed in `libc` has no differences \
whatsoever with the unsuffixed variant because we don't expose the fields that are \
function pointers."
)]
pub struct glob64_t {
pub gl_pathc: size_t,
pub gl_pathv: *mut *mut c_char,
Expand Down Expand Up @@ -173,36 +148,6 @@ s! {
__glibc_reserved5: Padding<c_ulong>,
}

pub struct statfs {
pub f_type: c_long,
pub f_bsize: c_long,
pub f_frsize: c_long,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_files: crate::fsblkcnt_t,
pub f_ffree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_fsid: crate::fsid_t,

pub f_namelen: c_long,
f_spare: [c_long; 6],
}

pub struct statfs64 {
pub f_type: c_long,
pub f_bsize: c_long,
pub f_frsize: c_long,
pub f_blocks: crate::fsblkcnt64_t,
pub f_bfree: crate::fsblkcnt64_t,
pub f_files: crate::fsblkcnt64_t,
pub f_ffree: crate::fsblkcnt64_t,
pub f_bavail: crate::fsblkcnt64_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_long,
pub f_flags: c_long,
pub f_spare: [c_long; 5],
}

pub struct msghdr {
pub msg_name: *mut c_void,
pub msg_namelen: crate::socklen_t,
Expand All @@ -228,16 +173,6 @@ s! {
pub c_cc: [crate::cc_t; crate::NCCS],
}

pub struct flock {
pub l_type: c_short,
pub l_whence: c_short,
pub l_start: off_t,
pub l_len: off_t,
pub l_sysid: c_long,
pub l_pid: crate::pid_t,
pad: Padding<[c_long; 4]>,
}

pub struct sysinfo {
pub uptime: c_long,
pub loads: [c_ulong; 3],
Expand Down Expand Up @@ -665,7 +600,6 @@ pub const SYS_process_mrelease: c_long = 4000 + 448;
pub const SYS_futex_waitv: c_long = 4000 + 449;
pub const SYS_set_mempolicy_home_node: c_long = 4000 + 450;

#[link(name = "util")]
extern "C" {
pub fn sysctl(
name: *mut c_int,
Expand All @@ -675,12 +609,26 @@ extern "C" {
newp: *mut c_void,
newlen: size_t,
) -> c_int;
#[deprecated(
since = "0.2.187",
note = "Use `glob` instead. The suffixed variant exposed in `libc` has no differences \
whatsoever with the unsuffixed variant because we don't expose the fields that are \
function pointers."
)]
#[allow(deprecated)]
pub fn glob64(
pattern: *const c_char,
flags: c_int,
errfunc: Option<extern "C" fn(epath: *const c_char, errno: c_int) -> c_int>,
pglob: *mut glob64_t,
) -> c_int;
#[deprecated(
since = "0.2.187",
note = "Use `glob` instead. The suffixed variant exposed in `libc` has no differences \
whatsoever with the unsuffixed variant because we don't expose the fields that are \
function pointers."
)]
#[allow(deprecated)]
pub fn globfree64(pglob: *mut glob64_t);
pub fn pthread_attr_getaffinity_np(
attr: *const crate::pthread_attr_t,
Expand Down
Loading