diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs index 3cc6fc837693e..f6c334fa2be47 100644 --- a/src/unix/linux_like/android/b64/aarch64/mod.rs +++ b/src/unix/linux_like/android/b64/aarch64/mod.rs @@ -1,4 +1,3 @@ -use crate::off64_t; use crate::prelude::*; pub type wchar_t = u32; @@ -15,7 +14,7 @@ s! { pub st_gid: crate::gid_t, pub st_rdev: crate::dev_t, __pad1: Padding, - pub st_size: off64_t, + pub st_size: crate::off_t, pub st_blksize: c_int, __pad2: Padding, pub st_blocks: c_long, @@ -29,6 +28,12 @@ s! { __unused5: Padding, } + #[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, @@ -38,7 +43,7 @@ s! { pub st_gid: crate::gid_t, pub st_rdev: crate::dev_t, __pad1: Padding, - pub st_size: off64_t, + pub st_size: crate::off64_t, pub st_blksize: c_int, __pad2: Padding, pub st_blocks: c_long, diff --git a/src/unix/linux_like/android/b64/mod.rs b/src/unix/linux_like/android/b64/mod.rs index 84c35a57f674a..aa79a94a0e055 100644 --- a/src/unix/linux_like/android/b64/mod.rs +++ b/src/unix/linux_like/android/b64/mod.rs @@ -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], @@ -21,6 +28,12 @@ s! { pub sa_restorer: Option, } + #[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, @@ -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, @@ -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, @@ -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], } diff --git a/src/unix/linux_like/android/b64/riscv64/mod.rs b/src/unix/linux_like/android/b64/riscv64/mod.rs index dded1292b393f..c4437d5ca8591 100644 --- a/src/unix/linux_like/android/b64/riscv64/mod.rs +++ b/src/unix/linux_like/android/b64/riscv64/mod.rs @@ -1,4 +1,3 @@ -use crate::off64_t; use crate::prelude::*; pub type wchar_t = u32; @@ -16,7 +15,7 @@ s! { pub st_gid: crate::gid_t, pub st_rdev: crate::dev_t, __pad1: Padding, - pub st_size: off64_t, + pub st_size: crate::off_t, pub st_blksize: c_int, __pad2: Padding, pub st_blocks: c_long, @@ -30,6 +29,13 @@ s! { __unused5: Padding, } + #[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, @@ -39,7 +45,7 @@ s! { pub st_gid: crate::gid_t, pub st_rdev: crate::dev_t, __pad1: Padding, - pub st_size: off64_t, + pub st_size: crate::off64_t, pub st_blksize: c_int, __pad2: Padding, pub st_blocks: c_long, diff --git a/src/unix/linux_like/android/b64/x86_64/mod.rs b/src/unix/linux_like/android/b64/x86_64/mod.rs index 0f3b74131449a..86b9c7ea8bb2f 100644 --- a/src/unix/linux_like/android/b64/x86_64/mod.rs +++ b/src/unix/linux_like/android/b64/x86_64/mod.rs @@ -1,4 +1,3 @@ -use crate::off64_t; use crate::prelude::*; pub type wchar_t = i32; @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index b262ff8a142c7..228df69a072c9 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -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; @@ -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; @@ -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, @@ -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, @@ -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; @@ -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, @@ -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, @@ -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; diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 172e44111e455..6d5d918b96202 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -2114,26 +2114,135 @@ cfg_if! { target_os = "emscripten", )))] { extern "C" { + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn fstatfs64(fd: c_int, buf: *mut statfs64) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn statvfs64(path: *const c_char, buf: *mut statvfs64) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn fstatvfs64(fd: c_int, buf: *mut statvfs64) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn statfs64(path: *const c_char, buf: *mut statfs64) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, and the `libc` crate is phasing out support for suffixed \ + types in favor of a single unsuffixed type with a fixed bit width." + ) + )] pub fn creat64(path: *const c_char, mode: mode_t) -> c_int; #[cfg_attr(gnu_time_bits64, link_name = "__fstat64_time64")] + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn fstat64(fildes: c_int, buf: *mut stat64) -> c_int; #[cfg_attr(gnu_time_bits64, link_name = "__fstatat64_time64")] #[cfg(not(target_os = "l4re"))] + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn fstatat64( dirfd: c_int, pathname: *const c_char, buf: *mut stat64, flags: c_int, ) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn ftruncate64(fd: c_int, length: off64_t) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t; #[cfg_attr(gnu_time_bits64, link_name = "__lstat64_time64")] #[cfg(not(target_os = "l4re"))] + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn lstat64(path: *const c_char, buf: *mut stat64) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn mmap64( addr: *mut c_void, len: size_t, @@ -2142,22 +2251,90 @@ cfg_if! { fd: c_int, offset: off64_t, ) -> *mut c_void; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, and the `libc` crate is phasing out support for suffixed \ + types in favor of a single unsuffixed type with a fixed bit width." + ) + )] pub fn open64(path: *const c_char, oflag: c_int, ...) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, and the `libc` crate is phasing out support for suffixed \ + types in favor of a single unsuffixed type with a fixed bit width." + ) + )] pub fn openat64(fd: c_int, path: *const c_char, oflag: c_int, ...) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn posix_fadvise64( fd: c_int, offset: off64_t, len: off64_t, advise: c_int, ) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn pread64(fd: c_int, buf: *mut c_void, count: size_t, offset: off64_t) -> ssize_t; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn pwrite64( fd: c_int, buf: *const c_void, count: size_t, offset: off64_t, ) -> ssize_t; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn readdir64_r( dirp: *mut crate::DIR, entry: *mut crate::dirent64, @@ -2165,7 +2342,27 @@ cfg_if! { ) -> c_int; #[cfg_attr(gnu_time_bits64, link_name = "__stat64_time64")] #[cfg(not(target_os = "l4re"))] + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn stat64(path: *const c_char, buf: *mut stat64) -> c_int; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `ftruncate` instead. Under 64-bit ABIs, Android aliases these \ + routines, 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 fn truncate64(path: *const c_char, length: off64_t) -> c_int; } } @@ -2179,12 +2376,32 @@ cfg_if! { target_os = "emscripten", )))] { extern "C" { + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `preadv` 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 preadv64( fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off64_t, ) -> ssize_t; + #[cfg_attr( + all(target_os = "android", target_pointer_width = "64"), + deprecated( + since = "0.2.187", + note = "Use `pwritev` 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 pwritev64( fd: c_int, iov: *const crate::iovec,