Bug 1806766 - Update libc to 0.2.139. r=emilio,supply-chain-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D165699
This commit is contained in:
Mike Hommey 2022-12-30 00:10:24 +00:00
parent 3a659506c8
commit b05baaf3df
26 changed files with 4924 additions and 69 deletions

4
Cargo.lock generated
View File

@ -2985,9 +2985,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
[[package]]
name = "libc"
version = "0.2.138"
version = "0.2.139"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8"
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
[[package]]
name = "libdbus-sys"

View File

@ -1054,6 +1054,11 @@ who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "0.2.132 -> 0.2.138"
[[audits.libc]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "0.2.138 -> 0.2.139"
[[audits.libloading]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@
[package]
name = "libc"
version = "0.2.138"
version = "0.2.139"
authors = ["The Rust Project Developers"]
build = "build.rs"
exclude = [

View File

@ -3402,11 +3402,16 @@ extern "C" {
pub fn feof(stream: *mut FILE) -> c_int;
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn perror(s: *const c_char);
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
@ -3448,7 +3453,6 @@ extern "C" {
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn abs(i: c_int) -> c_int;
pub fn atof(s: *const c_char) -> c_double;
pub fn labs(i: c_long) -> c_long;
pub fn rand() -> c_int;
pub fn srand(seed: c_uint);

View File

@ -613,7 +613,6 @@ extern "C" {
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
#[cfg_attr(
all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),

View File

@ -1592,7 +1592,6 @@ extern "C" {
pub fn _errnop() -> *mut ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);

View File

@ -966,7 +966,6 @@ extern "C" {
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);

View File

@ -501,6 +501,9 @@ pub const SYS_pwritev2: ::c_long = 393;
pub const SYS_pkey_mprotect: ::c_long = 394;
pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
// offsets in mcontext_t.gregs from sys/ucontext.h
pub const REG_R0: ::c_int = 0;

View File

@ -533,6 +533,9 @@ pub const SYS_pwritev2: ::c_long = 379;
pub const SYS_pkey_mprotect: ::c_long = 380;
pub const SYS_pkey_alloc: ::c_long = 381;
pub const SYS_pkey_free: ::c_long = 382;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
// offsets in user_regs_structs, from sys/reg.h
pub const EBX: ::c_int = 0;

View File

@ -374,6 +374,9 @@ pub const SYS_pwritev2: ::c_long = 287;
pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
pub const SYS_syscalls: ::c_long = 436;
cfg_if! {

View File

@ -728,6 +728,9 @@ pub const SYS_pwritev2: ::c_long = 328;
pub const SYS_pkey_mprotect: ::c_long = 329;
pub const SYS_pkey_alloc: ::c_long = 330;
pub const SYS_pkey_free: ::c_long = 331;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
// offsets in user_regs_structs, from sys/reg.h
pub const R15: ::c_int = 0;

View File

@ -2421,9 +2421,20 @@ pub const SND_CNT: usize = SND_MAX as usize + 1;
pub const UINPUT_VERSION: ::c_uint = 5;
pub const UINPUT_MAX_NAME_SIZE: usize = 80;
// bionic/libc/kernel/uapi/linux/if_tun.h
pub const IFF_TUN: ::c_int = 0x0001;
pub const IFF_TAP: ::c_int = 0x0002;
pub const IFF_NAPI: ::c_int = 0x0010;
pub const IFF_NAPI_FRAGS: ::c_int = 0x0020;
pub const IFF_NO_PI: ::c_int = 0x1000;
pub const IFF_ONE_QUEUE: ::c_int = 0x2000;
pub const IFF_VNET_HDR: ::c_int = 0x4000;
pub const IFF_TUN_EXCL: ::c_int = 0x8000;
pub const IFF_MULTI_QUEUE: ::c_int = 0x0100;
pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200;
pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
pub const IFF_PERSIST: ::c_int = 0x0800;
pub const IFF_NOFILTER: ::c_int = 0x1000;
// start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h
// from https://android.googlesource.com/
@ -2615,10 +2626,10 @@ pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
pub const IN_IGNORED: u32 = 0x0000_8000;
pub const IN_ONLYDIR: u32 = 0x0100_0000;
pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
// pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
// pub const IN_MASK_CREATE: u32 = 0x1000_0000;
// pub const IN_MASK_ADD: u32 = 0x2000_0000;
pub const IN_MASK_CREATE: u32 = 0x1000_0000;
pub const IN_MASK_ADD: u32 = 0x2000_0000;
pub const IN_ISDIR: u32 = 0x4000_0000;
pub const IN_ONESHOT: u32 = 0x8000_0000;
@ -2739,6 +2750,12 @@ pub const PF_VSOCK: ::c_int = AF_VSOCK;
pub const SOMAXCONN: ::c_int = 128;
// sys/prctl.h
pub const PR_SET_PDEATHSIG: ::c_int = 1;
pub const PR_GET_PDEATHSIG: ::c_int = 2;
pub const PR_GET_SECUREBITS: ::c_int = 27;
pub const PR_SET_SECUREBITS: ::c_int = 28;
// sys/system_properties.h
pub const PROP_VALUE_MAX: ::c_int = 92;
pub const PROP_NAME_MAX: ::c_int = 32;
@ -3446,6 +3463,10 @@ extern "C" {
pub fn gettid() -> ::pid_t;
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
pub fn __system_property_set(__name: *const ::c_char, __value: *const ::c_char) -> ::c_int;
pub fn __system_property_get(__name: *const ::c_char, __value: *mut ::c_char) -> ::c_int;
pub fn __system_property_find(__name: *const ::c_char) -> *const prop_info;

View File

@ -1763,7 +1763,6 @@ extern "C" {
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);

View File

@ -1583,6 +1583,10 @@ pub const AT_HWCAP2: ::c_ulong = 26;
pub const AT_EXECFN: ::c_ulong = 31;
// defined in arch/<arch>/include/uapi/asm/auxvec.h but has the same value
// wherever it is defined.
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
pub const GLOB_ERR: ::c_int = 1 << 0;
pub const GLOB_MARK: ::c_int = 1 << 1;
pub const GLOB_NOSORT: ::c_int = 1 << 2;
@ -3061,7 +3065,7 @@ pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
pub const IN_IGNORED: u32 = 0x0000_8000;
pub const IN_ONLYDIR: u32 = 0x0100_0000;
pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
// pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
// linux/keyctl.h
pub const KEY_SPEC_THREAD_KEYRING: i32 = -1;
@ -3107,8 +3111,8 @@ pub const KEYCTL_INSTANTIATE_IOV: u32 = 20;
pub const KEYCTL_INVALIDATE: u32 = 21;
pub const KEYCTL_GET_PERSISTENT: u32 = 22;
// pub const IN_MASK_CREATE: u32 = 0x1000_0000;
// pub const IN_MASK_ADD: u32 = 0x2000_0000;
pub const IN_MASK_CREATE: u32 = 0x1000_0000;
pub const IN_MASK_ADD: u32 = 0x2000_0000;
pub const IN_ISDIR: u32 = 0x4000_0000;
pub const IN_ONESHOT: u32 = 0x8000_0000;
@ -3800,7 +3804,6 @@ extern "C" {
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);

View File

@ -1615,6 +1615,14 @@ safe_f! {
pub {const} fn IPTOS_ECN(x: u8) -> u8 {
x & ::IPTOS_ECN_MASK
}
#[allow(ellipsis_inclusive_range_patterns)]
pub {const} fn KERNEL_VERSION(a: u32, b: u32, c: u32) -> u32 {
((a << 16) + (b << 8)) + match c {
0 ... 255 => c,
_ => 255,
}
}
}
extern "C" {

View File

@ -32,6 +32,9 @@ cfg_if! {
if #[cfg(any(target_os = "espidf", target_os = "horizon"))] {
pub type uid_t = ::c_ushort;
pub type gid_t = ::c_ushort;
} else if #[cfg(target_os = "nto")] {
pub type uid_t = i32;
pub type gid_t = i32;
} else {
pub type uid_t = u32;
pub type gid_t = u32;
@ -209,7 +212,8 @@ pub const INT_MAX: c_int = 2147483647;
pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
pub const SIG_ERR: sighandler_t = !0 as sighandler_t;
cfg_if! {
if #[cfg(not(target_os = "nto"))] {
pub const DT_UNKNOWN: u8 = 0;
pub const DT_FIFO: u8 = 1;
pub const DT_CHR: u8 = 2;
@ -218,16 +222,21 @@ pub const DT_BLK: u8 = 6;
pub const DT_REG: u8 = 8;
pub const DT_LNK: u8 = 10;
pub const DT_SOCK: u8 = 12;
}
}
cfg_if! {
if #[cfg(not(target_os = "redox"))] {
pub const FD_CLOEXEC: ::c_int = 0x1;
}
}
cfg_if! {
if #[cfg(not(target_os = "nto"))]
{
pub const USRQUOTA: ::c_int = 0;
pub const GRPQUOTA: ::c_int = 1;
}
}
pub const SIGIOT: ::c_int = 6;
pub const S_ISUID: ::mode_t = 0x800;
@ -281,9 +290,13 @@ cfg_if! {
pub const LOG_PRIMASK: ::c_int = 7;
pub const LOG_FACMASK: ::c_int = 0x3f8;
cfg_if! {
if #[cfg(not(target_os = "nto"))]
{
pub const PRIO_MIN: ::c_int = -20;
pub const PRIO_MAX: ::c_int = 20;
}
}
pub const IPPROTO_ICMP: ::c_int = 1;
pub const IPPROTO_ICMPV6: ::c_int = 58;
pub const IPPROTO_TCP: ::c_int = 6;
@ -361,7 +374,9 @@ cfg_if! {
target_os = "tvos",
target_os = "watchos",
target_os = "android",
target_os = "openbsd"))] {
target_os = "openbsd",
target_os = "nto",
))] {
#[link(name = "c")]
#[link(name = "m")]
extern {}
@ -453,8 +468,6 @@ extern "C" {
link_name = "freopen$UNIX2003"
)]
pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE;
pub fn fmemopen(buf: *mut c_void, size: size_t, mode: *const c_char) -> *mut FILE;
pub fn open_memstream(ptr: *mut *mut c_char, sizeloc: *mut size_t) -> *mut FILE;
pub fn fflush(file: *mut FILE) -> c_int;
pub fn fclose(file: *mut FILE) -> c_int;
@ -492,7 +505,10 @@ extern "C" {
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn clearerr(stream: *mut FILE);
pub fn perror(s: *const c_char);
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "strtod$UNIX2003"
@ -500,7 +516,9 @@ extern "C" {
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
@ -508,7 +526,6 @@ extern "C" {
pub fn abort() -> !;
pub fn exit(status: c_int) -> !;
pub fn _exit(status: c_int) -> !;
pub fn atexit(cb: extern "C" fn()) -> c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "system$UNIX2003"
@ -1162,8 +1179,6 @@ extern "C" {
optlen: *mut ::socklen_t,
) -> ::c_int;
pub fn raise(signum: ::c_int) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")]
pub fn sigaction(signum: ::c_int, act: *const sigaction, oldact: *mut sigaction) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__utimes50")]
pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
@ -1325,8 +1340,6 @@ extern "C" {
pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
#[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")]
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")]
@ -1347,23 +1360,6 @@ extern "C" {
pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86_64"),
link_name = "pselect$1050"
)]
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pselect$UNIX2003"
)]
#[cfg_attr(target_os = "netbsd", link_name = "__pselect50")]
pub fn pselect(
nfds: ::c_int,
readfds: *mut fd_set,
writefds: *mut fd_set,
errorfds: *mut fd_set,
timeout: *const timespec,
sigmask: *const sigset_t,
) -> ::c_int;
pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
pub fn ftello(stream: *mut ::FILE) -> ::off_t;
#[cfg_attr(
@ -1411,7 +1407,8 @@ extern "C" {
cfg_if! {
if #[cfg(not(any(target_os = "emscripten",
target_os = "android",
target_os = "haiku")))] {
target_os = "haiku",
target_os = "nto")))] {
extern "C" {
pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> ::c_int;
pub fn stpncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
@ -1420,7 +1417,7 @@ cfg_if! {
}
cfg_if! {
if #[cfg(not(target_env = "uclibc"))] {
if #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] {
extern "C" {
pub fn open_wmemstream(
ptr: *mut *mut wchar_t,
@ -1439,10 +1436,6 @@ cfg_if! {
link_name = "pause$UNIX2003")]
pub fn pause() -> ::c_int;
pub fn readlinkat(dirfd: ::c_int,
pathname: *const ::c_char,
buf: *mut ::c_char,
bufsiz: ::size_t) -> ::ssize_t;
pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
mode: ::mode_t) -> ::c_int;
pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
@ -1475,7 +1468,64 @@ cfg_if! {
}
cfg_if! {
if #[cfg(not(any(target_os = "solaris", target_os = "illumos")))] {
if #[cfg(target_os = "nto")] {
extern {
pub fn readlinkat(dirfd: ::c_int,
pathname: *const ::c_char,
buf: *mut ::c_char,
bufsiz: ::size_t) -> ::c_int;
pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::c_int;
pub fn pselect(
nfds: ::c_int,
readfds: *mut fd_set,
writefds: *mut fd_set,
errorfds: *mut fd_set,
timeout: *mut timespec,
sigmask: *const sigset_t,
) -> ::c_int;
}
} else {
extern {
pub fn readlinkat(dirfd: ::c_int,
pathname: *const ::c_char,
buf: *mut ::c_char,
bufsiz: ::size_t) -> ::ssize_t;
pub fn fmemopen(buf: *mut c_void, size: size_t, mode: *const c_char) -> *mut FILE;
pub fn open_memstream(ptr: *mut *mut c_char, sizeloc: *mut size_t) -> *mut FILE;
pub fn atexit(cb: extern "C" fn()) -> c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")]
pub fn sigaction(
signum: ::c_int,
act: *const sigaction,
oldact: *mut sigaction
) -> ::c_int;
pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86_64"),
link_name = "pselect$1050"
)]
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pselect$UNIX2003"
)]
#[cfg_attr(target_os = "netbsd", link_name = "__pselect50")]
pub fn pselect(
nfds: ::c_int,
readfds: *mut fd_set,
writefds: *mut fd_set,
errorfds: *mut fd_set,
timeout: *const timespec,
sigmask: *const sigset_t,
) -> ::c_int;
}
}
}
cfg_if! {
if #[cfg(not(any(target_os = "solaris",
target_os = "illumos",
target_os = "nto",
)))] {
extern {
pub fn cfmakeraw(termios: *mut ::termios);
pub fn cfsetspeed(termios: *mut ::termios,
@ -1517,6 +1567,9 @@ cfg_if! {
} else if #[cfg(target_os = "redox")] {
mod redox;
pub use self::redox::*;
} else if #[cfg(target_os = "nto")] {
mod nto;
pub use self::nto::*;
} else {
// Unknown target_os
}

View File

@ -621,7 +621,6 @@ extern "C" {
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);

View File

@ -0,0 +1,36 @@
pub type c_char = u8;
pub type wchar_t = u32;
pub type c_long = i64;
pub type c_ulong = u64;
pub type time_t = i64;
s! {
pub struct aarch64_qreg_t {
pub qlo: u64,
pub qhi: u64,
}
pub struct aarch64_fpu_registers {
pub reg: [::aarch64_qreg_t; 32],
pub fpsr: u32,
pub fpcr: u32,
}
pub struct aarch64_cpu_registers {
pub gpr: [u64; 32],
pub elr: u64,
pub pstate: u64,
}
#[repr(align(16))]
pub struct mcontext_t {
pub cpu: ::aarch64_cpu_registers,
pub fpu: ::aarch64_fpu_registers,
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
}
}

3286
third_party/rust/libc/src/unix/nto/mod.rs vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,132 @@
pub type c_char = i8;
pub type wchar_t = u32;
pub type c_long = i64;
pub type c_ulong = u64;
pub type time_t = i64;
s! {
#[repr(align(8))]
pub struct x86_64_cpu_registers {
pub rdi: u64,
pub rsi: u64,
pub rdx: u64,
pub r10: u64,
pub r8: u64,
pub r9: u64,
pub rax: u64,
pub rbx: u64,
pub rbp: u64,
pub rcx: u64,
pub r11: u64,
pub r12: u64,
pub r13: u64,
pub r14: u64,
pub r15: u64,
pub rip: u64,
pub cs: u32,
rsvd1: u32,
pub rflags: u64,
pub rsp: u64,
pub ss: u32,
rsvd2: u32,
}
#[repr(align(8))]
pub struct mcontext_t {
pub cpu: x86_64_cpu_registers,
#[cfg(libc_union)]
pub fpu: x86_64_fpu_registers,
#[cfg(not(libc_union))]
__reserved: [u8; 1024],
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
}
pub struct fsave_area_64 {
pub fpu_control_word: u32,
pub fpu_status_word: u32,
pub fpu_tag_word: u32,
pub fpu_ip: u32,
pub fpu_cs: u32,
pub fpu_op: u32,
pub fpu_ds: u32,
pub st_regs: [u8; 80],
}
pub struct fxsave_area_64 {
pub fpu_control_word: u16,
pub fpu_status_word: u16,
pub fpu_tag_word: u16,
pub fpu_operand: u16,
pub fpu_rip: u64,
pub fpu_rdp: u64,
pub mxcsr: u32,
pub mxcsr_mask: u32,
pub st_regs: [u8; 128],
pub xmm_regs: [u8; 128],
reserved2: [u8; 224],
}
pub struct fpu_extention_savearea_64 {
pub other: [u8; 512],
pub xstate_bv: u64,
pub xstate_undef: [u64; 7],
pub xstate_info: [u8; 224],
}
}
s_no_extra_traits! {
#[cfg(libc_union)]
pub union x86_64_fpu_registers {
pub fsave_area: fsave_area_64,
pub fxsave_area: fxsave_area_64,
pub xsave_area: fpu_extention_savearea_64,
pub data: [u8; 1024],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
#[cfg(libc_union)]
impl Eq for x86_64_fpu_registers {}
#[cfg(libc_union)]
impl PartialEq for x86_64_fpu_registers {
fn eq(&self, other: &x86_64_fpu_registers) -> bool {
unsafe {
self.fsave_area == other.fsave_area
|| self.fxsave_area == other.fxsave_area
|| self.xsave_area == other.xsave_area
}
}
}
#[cfg(libc_union)]
impl ::fmt::Debug for x86_64_fpu_registers {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
unsafe {
f.debug_struct("x86_64_fpu_registers")
.field("fsave_area", &self.fsave_area)
.field("fxsave_area", &self.fxsave_area)
.field("xsave_area", &self.xsave_area)
.finish()
}
}
}
#[cfg(libc_union)]
impl ::hash::Hash for x86_64_fpu_registers {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
unsafe {
self.fsave_area.hash(state);
self.fxsave_area.hash(state);
self.xsave_area.hash(state);
}
}
}
}
}

View File

@ -2710,7 +2710,6 @@ extern "C" {
pub fn abs(i: ::c_int) -> ::c_int;
pub fn acct(filename: *const ::c_char) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;

View File

@ -1119,11 +1119,16 @@ extern "C" {
pub fn feof(stream: *mut FILE) -> c_int;
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn perror(s: *const c_char);
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;

View File

@ -540,12 +540,16 @@ extern "C" {
pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;

View File

@ -329,11 +329,16 @@ extern "C" {
pub fn feof(stream: *mut FILE) -> c_int;
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn perror(s: *const c_char);
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
@ -374,7 +379,6 @@ extern "C" {
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn abs(i: c_int) -> c_int;
pub fn atof(s: *const c_char) -> c_double;
pub fn labs(i: c_long) -> c_long;
pub fn rand() -> c_int;
pub fn srand(seed: c_uint);