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
24 changes: 2 additions & 22 deletions src/fuchsia/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ pub type wchar_t = u32;
pub type nlink_t = c_ulong;
pub type blksize_t = c_long;

pub type stat64 = stat;

s! {
pub struct stat {
pub st_dev: crate::dev_t,
Expand All @@ -29,28 +31,6 @@ s! {
__unused: Padding<[c_uint; 2]>,
}

pub struct stat64 {
pub st_dev: crate::dev_t,
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: crate::dev_t,
__pad0: Padding<c_ulong>,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
__pad1: Padding<c_int>,
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,
__unused: Padding<[c_uint; 2]>,
}

pub struct ipc_perm {
pub __ipc_perm_key: crate::key_t,
pub uid: crate::uid_t,
Expand Down
74 changes: 48 additions & 26 deletions src/fuchsia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,37 @@ pub type dev_t = u64;
pub type socklen_t = u32;
pub type pthread_t = c_ulong;
pub type mode_t = u32;
pub type ino64_t = u64;
pub type off64_t = i64;
pub type blkcnt64_t = i64;
pub type rlim64_t = u64;
pub type mqd_t = c_int;
pub type nfds_t = c_ulong;
pub type nl_item = c_int;
pub type idtype_t = c_uint;
pub type loff_t = c_longlong;

#[deprecated(
since = "0.2.187",
note = "Use `off_t` instead. All currently supported Rust targets in Fuchsia follow LP64. \
Their suffixed types are equivalent to their unsuffixed types."
)]
pub type off64_t = i64;
#[deprecated(
since = "0.2.187",
note = "Use `ino_t` instead. All currently supported Rust targets in Fuchsia follow LP64. \
Their suffixed types are equivalent to their unsuffixed types."
)]
pub type ino64_t = u64;
#[deprecated(
since = "0.2.187",
note = "Use `blkcnt_t` instead. All currently supported Rust targets in Fuchsia follow LP64. \
Their suffixed types are equivalent to their unsuffixed types."
)]
pub type blkcnt64_t = i64;
#[deprecated(
since = "0.2.187",
note = "Use `rlim_t` instead. All currently supported Rust targets in Fuchsia follow LP64. \
Their suffixed types are equivalent to their unsuffixed types."
)]
pub type rlim64_t = u64;

pub type __u8 = c_uchar;
pub type __u16 = c_ushort;
pub type __s16 = c_short;
Expand Down Expand Up @@ -78,9 +99,16 @@ pub type fsblkcnt_t = c_ulonglong;
pub type fsfilcnt_t = c_ulonglong;
pub type rlim_t = c_ulonglong;

pub type statfs64 = statfs;

extern_ty! {
pub enum timezone {}
pub enum DIR {}

#[deprecated(
since = "0.2.187",
note = "Use `fpos_t` instead. This type does not exist upstream."
)]
pub enum fpos64_t {} // FIXME(fuchsia): fill this out with a struct
}

Expand Down Expand Up @@ -418,6 +446,11 @@ s! {
pub int_n_sign_posn: c_char,
}

#[deprecated(
since = "0.2.187",
note = "Use `rlimit` instead. All currently supported Rust targets in Fuchsia follow LP64. \
Their suffixed types are equivalent to their unsuffixed types."
)]
pub struct rlimit64 {
pub rlim_cur: rlim64_t,
pub rlim_max: rlim64_t,
Expand Down Expand Up @@ -477,11 +510,6 @@ s! {
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(all(target_pointer_width = "32", not(target_arch = "x86_64")))]
__f_unused: Padding<c_int>,
#[cfg(target_endian = "big")]
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
Expand Down Expand Up @@ -722,21 +750,10 @@ s! {
pub p_align: Elf64_Xword,
}

pub struct statfs64 {
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,
pub f_spare: [c_ulong; 4],
}

#[deprecated(
since = "0.2.187",
note = "Use `statvfs` instead. This type doesn't exist upstream."
)]
pub struct statvfs64 {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
Expand Down Expand Up @@ -923,6 +940,11 @@ s! {
pub d_name: [c_char; 256],
}

#[deprecated(
since = "0.2.187",
note = "Use `drient` instead. This type doesn't exist upstream."
)]
#[allow(deprecated)]
pub struct dirent64 {
pub d_ino: crate::ino64_t,
pub d_off: off64_t,
Expand Down Expand Up @@ -3797,7 +3819,7 @@ extern "C" {

pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int;
pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
pub fn readahead(fd: c_int, offset: off64_t, count: size_t) -> ssize_t;
pub fn readahead(fd: c_int, offset: off_t, count: size_t) -> ssize_t;
pub fn signalfd(fd: c_int, mask: *const crate::sigset_t, flags: c_int) -> c_int;
pub fn timerfd_create(clockid: c_int, flags: c_int) -> c_int;
pub fn timerfd_gettime(fd: c_int, curr_value: *mut itimerspec) -> c_int;
Expand Down Expand Up @@ -3837,7 +3859,7 @@ extern "C" {
pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: mode_t) -> c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
pub fn sync_file_range(fd: c_int, offset: off64_t, nbytes: off64_t, flags: c_uint) -> c_int;
pub fn sync_file_range(fd: c_int, offset: off_t, nbytes: off_t, flags: c_uint) -> c_int;
pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int;
pub fn freeifaddrs(ifa: *mut crate::ifaddrs);

Expand Down
3 changes: 2 additions & 1 deletion src/fuchsia/riscv64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub type nlink_t = c_ulong;
pub type blksize_t = c_long;

pub type stat64 = stat;

s! {
pub struct stat {
pub st_dev: crate::dev_t,
Expand All @@ -17,7 +18,7 @@ s! {
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
__pad0: Padding<c_int>,
__pad0: Padding<c_uint>,
pub st_rdev: crate::dev_t,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
Expand Down
25 changes: 3 additions & 22 deletions src/fuchsia/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ pub type nlink_t = u64;
pub type blksize_t = c_long;
pub type __u64 = c_ulonglong;

pub type stat64 = stat;

s! {
pub struct stat {
pub st_dev: crate::dev_t,
Expand All @@ -14,7 +16,7 @@ s! {
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
__pad0: Padding<c_int>,
__pad0: Padding<c_uint>,
pub st_rdev: crate::dev_t,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
Expand All @@ -28,27 +30,6 @@ s! {
__unused: Padding<[c_long; 3]>,
}

pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino64_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
__pad0: Padding<c_int>,
pub st_rdev: crate::dev_t,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_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,
__reserved: Padding<[c_long; 3]>,
}

pub struct mcontext_t {
__private: [u64; 32],
}
Expand Down