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
11 changes: 8 additions & 3 deletions src/unix/linux_like/android/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::off64_t;
use crate::prelude::*;

pub type wchar_t = u32;
Expand All @@ -15,7 +14,7 @@ s! {
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad1: Padding<c_ulong>,
pub st_size: off64_t,
pub st_size: crate::off_t,
pub st_blksize: c_int,
__pad2: Padding<c_int>,
pub st_blocks: c_long,
Expand All @@ -29,6 +28,12 @@ s! {
__unused5: Padding<c_uint>,
}

#[deprecated(
since = "0.2.187",
note = "Use `stat` instead. Under 64-bit ABIs, Android aliases these types, and the `libc` \
crate is phasing out support for suffixed types in favor of a single, fixed-width unsuffixed type."
)]
#[allow(deprecated)]
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
Expand All @@ -38,7 +43,7 @@ s! {
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad1: Padding<c_ulong>,
pub st_size: off64_t,
pub st_size: crate::off64_t,
pub st_blksize: c_int,
__pad2: Padding<c_int>,
pub st_blocks: c_long,
Expand Down
33 changes: 32 additions & 1 deletion src/unix/linux_like/android/b64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ use crate::prelude::*;
// but may be wrong for mips64

pub type mode_t = u32;
pub type off64_t = i64;
pub type socklen_t = u32;

#[deprecated(
since = "0.2.187",
note = "Use `off_t` instead. Under 64-bit ABIs, Android just aliases these two types, and the \
`libc` crate is phasing out support for suffixed types in favor of exposing a single, \
fixed-width unsuffixed type."
)]
pub type off64_t = i64;

s! {
pub struct sigset_t {
__val: [c_ulong; 1],
Expand All @@ -21,6 +28,12 @@ s! {
pub sa_restorer: Option<extern "C" fn()>,
}

#[deprecated(
since = "0.2.187",
note = "Use `rlimit` instead. Under 64-bit ABIs, Android aliases these types, and the \
`libc` crate is phasing out support for suffixed variants in favor of a single, \
fixed-width suffixed type."
)]
pub struct rlimit64 {
pub rlim_cur: c_ulonglong,
pub rlim_max: c_ulonglong,
Expand Down Expand Up @@ -78,6 +91,12 @@ s! {
pub _f: [c_char; 0],
}

#[deprecated(
since = "0.2.187",
note = "Use `statfs` instead. Under 64-bit ABIs, Android aliases these types, and the \
`libc` crate is phasing out support for suffixed types in favor of a single \
unsuffixed type with a fixed bit width."
)]
pub struct statfs64 {
pub f_type: u64,
pub f_bsize: u64,
Expand All @@ -93,6 +112,12 @@ s! {
pub f_spare: [u64; 4],
}

#[deprecated(
since = "0.2.187",
note = "Use `statfs` instead. Under 64-bit ABIs, Android aliases these types, and the \
`libc` crate is phasing out support for suffixed types in favor of a single \
unsuffixed type with a fixed bit width."
)]
pub struct statvfs64 {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
Expand Down Expand Up @@ -135,6 +160,12 @@ s! {
__reserved: Padding<[c_char; 36]>,
}

#[deprecated(
since = "0.2.187",
note = "Use `sigset_t` instead. Under 64-bit ABIs, Android aliases these types, and the \
`libc` crate is phasing out support for suffixed variants in favor of a single, \
unsuffixed type with a fixed bit width."
)]
pub struct sigset64_t {
__bits: [c_ulong; 1],
}
Expand Down
12 changes: 9 additions & 3 deletions src/unix/linux_like/android/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::off64_t;
use crate::prelude::*;

pub type wchar_t = u32;
Expand All @@ -16,7 +15,7 @@ s! {
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad1: Padding<c_ulong>,
pub st_size: off64_t,
pub st_size: crate::off_t,
pub st_blksize: c_int,
__pad2: Padding<c_int>,
pub st_blocks: c_long,
Expand All @@ -30,6 +29,13 @@ s! {
__unused5: Padding<c_uint>,
}

#[deprecated(
since = "0.2.187",
note = "Use `stat` instead. Under 64-bit ABIs, Android aliases these types, and the `libc` \
crate is phasing out support for suffixed types in favor of a single unsuffixed \
type with a fixed bit width."
)]
#[allow(deprecated)]
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
Expand All @@ -39,7 +45,7 @@ s! {
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad1: Padding<c_ulong>,
pub st_size: off64_t,
pub st_size: crate::off64_t,
pub st_blksize: c_int,
__pad2: Padding<c_int>,
pub st_blocks: c_long,
Expand Down
13 changes: 10 additions & 3 deletions src/unix/linux_like/android/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::off64_t;
use crate::prelude::*;

pub type wchar_t = i32;
Expand All @@ -15,7 +14,7 @@ s! {
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub st_size: off64_t,
pub st_size: crate::off_t,
pub st_blksize: c_long,
pub st_blocks: c_long,
pub st_atime: c_long,
Expand All @@ -27,6 +26,13 @@ s! {
__unused: Padding<[c_long; 3]>,
}

#[deprecated(
since = "0.2.187",
note = "Use `stat` instead. Under 64-bit ABIs, Android aliases these types, and the `libc` \
crate is phasing out support for suffixed types in favor of a single, unsuffixed, \
fixed-width type."
)]
#[allow(deprecated)]
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
Expand All @@ -35,7 +41,7 @@ s! {
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub st_size: off64_t,
pub st_size: crate::off64_t,
pub st_blksize: c_long,
pub st_blocks: c_long,
pub st_atime: c_long,
Expand Down Expand Up @@ -156,6 +162,7 @@ s! {
}

s_no_extra_traits! {
#[allow(deprecated)]
pub union __c_anonymous_uc_sigmask {
uc_sigmask: crate::sigset_t,
uc_sigmask64: crate::sigset64_t,
Expand Down
87 changes: 86 additions & 1 deletion src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ pub type nfds_t = c_uint;
pub type rlim_t = c_ulong;
pub type dev_t = c_ulong;
pub type ino_t = c_ulong;
pub type ino64_t = u64;
pub type __CPU_BITTYPE = c_ulong;
pub type idtype_t = c_int;
pub type loff_t = c_longlong;
Expand All @@ -48,6 +47,17 @@ pub type __u32 = c_uint;
pub type __s32 = c_int;
pub type __be16 = __u16;

#[cfg_attr(
target_pointer_width = "64",
deprecated(
since = "0.2.187",
note = "Use `ino_t` instead. Under 64-bit ABIs, Android aliases these types and the `libc` \
crate is phasing out support for suffixed variants in favor of a single, \
fixed-width unsuffixed type."
)
)]
pub type ino64_t = u64;

// linux/elf.h

pub type Elf32_Addr = u32;
Expand Down Expand Up @@ -119,6 +129,15 @@ s! {
pub l_pid: crate::pid_t,
}

#[cfg_attr(
target_pointer_width = "64",
deprecated(
since = "0.2.187",
note = "Use `flock` instead. Under 64-bit ABIs, Android aliases these types, and the \
`libc` crate is phasing out support for suffixed variants in favor of a single, \
unsuffixed, fixed-width symbol."
)
)]
pub struct flock64 {
pub l_type: c_short,
pub l_whence: c_short,
Expand Down Expand Up @@ -511,6 +530,12 @@ s! {
pub d_name: [c_char; 256],
}

#[deprecated(
since = "0.2.187",
note = "Use `dirent` instead. This type is defined as an alias to it and the `libc` crate \
is phasing out support for suffixed types in favor of a single, fixed-width \
unsuffixed type."
)]
pub struct dirent64 {
pub d_ino: u64,
pub d_off: i64,
Expand Down Expand Up @@ -3382,7 +3407,27 @@ extern "C" {
pub fn setgrent();
pub fn endgrent();
pub fn getgrent() -> *mut crate::group;
#[cfg_attr(
target_pointer_width = "64",
deprecated(
since = "0.2.187",
note = "Use `getrlimit` instead. Under 64-bit ABIs, Android aliases these types and the \
`libc` crate is phasing out support for suffixed variants in favor of a single, \
fixed-width, unsuffixed type."
),
allow(deprecated)
)]
pub fn getrlimit64(resource: c_int, rlim: *mut rlimit64) -> c_int;
#[cfg_attr(
target_pointer_width = "64",
deprecated(
since = "0.2.187",
note = "Use `setrlimit` instead. Under 64-bit ABIs, Android aliases these types and the \
`libc` crate is phasing out support for suffixed variants in favor of a single, \
fixed-width, unsuffixed type."
),
allow(deprecated)
)]
pub fn setrlimit64(resource: c_int, rlim: *const rlimit64) -> c_int;
pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int;
pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int;
Expand All @@ -3392,6 +3437,16 @@ extern "C" {
new_limit: *const crate::rlimit,
old_limit: *mut crate::rlimit,
) -> c_int;
#[cfg_attr(
target_pointer_width = "64",
deprecated(
since = "0.2.187",
note = "Use `prlimit` instead. Under 64-bit ABIs, Android aliases these types and the \
`libc` crate is phasing out support for suffixed variants in favor of a single, \
fixed-width, unsuffixed type."
),
allow(deprecated)
)]
pub fn prlimit64(
pid: crate::pid_t,
resource: c_int,
Expand Down Expand Up @@ -3452,8 +3507,28 @@ extern "C" {
pub fn seekdir(dirp: *mut crate::DIR, loc: c_long);
pub fn telldir(dirp: *mut crate::DIR) -> c_long;
pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int;
#[cfg_attr(
target_pointer_width = "64",
deprecated(
since = "0.2.187",
note = "Use `fallocate` instead. Under 64-bit ABIs, Android aliases these types and \
the `libc` crate is phasing out support for suffixed variants in favor of a \
fixed-width unsuffixed type."
),
allow(deprecated)
)]
pub fn fallocate64(fd: c_int, mode: c_int, offset: off64_t, len: off64_t) -> c_int;
pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int;
#[cfg_attr(
target_pointer_width = "64",
deprecated(
since = "0.2.187",
note = "Use `posix_fallocate` instead. Under 64-bit ABIs, Android aliases these types \
and the `libc` crate is phasing out support for suffixed variants in favor of \
a fixed-width unsuffixed type."
),
allow(deprecated)
)]
pub fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int;
pub fn getxattr(
path: *const c_char,
Expand Down Expand Up @@ -3610,6 +3685,16 @@ extern "C" {
param: *const crate::sched_param,
) -> c_int;
pub fn sendfile(out_fd: c_int, in_fd: c_int, offset: *mut off_t, count: size_t) -> ssize_t;
#[cfg_attr(
target_pointer_width = "64",
deprecated(
since = "0.2.187",
note = "Use `sendfile` instead. Under 64-bit ABIs, Android aliases these types and the \
`libc` crate is phasing out support for suffixed variants in favor of a single \
unsuffixed type with a fixed bit-width."
),
allow(deprecated)
)]
pub fn sendfile64(out_fd: c_int, in_fd: c_int, offset: *mut off64_t, count: size_t) -> ssize_t;
pub fn setfsgid(gid: crate::gid_t) -> c_int;
pub fn setfsuid(uid: crate::uid_t) -> c_int;
Expand Down
Loading