diff --git a/.cirrus.yml b/.cirrus.yml index 7968772921d40..7985cb854bbe3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -12,13 +12,13 @@ task: env: TARGET: i686-unknown-freebsd freebsd_instance: - image_family: freebsd-13-3 + image_family: freebsd-13-4 - name: nightly freebsd-13 x86_64 freebsd_instance: - image_family: freebsd-13-3 + image_family: freebsd-13-4 - name: nightly freebsd-14 x86_64 freebsd_instance: - image: freebsd-14-1-release-amd64-ufs + image: freebsd-14-2-release-amd64-ufs - name: nightly freebsd-15 x86_64 freebsd_instance: image_family: freebsd-15-0-snap diff --git a/README.md b/README.md index 89a9f69d6a37c..cd636336b5556 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ but this is not guaranteed. You can see the platform(target)-specific docs on [docs.rs], select a platform you want to see. -See [`ci/build.sh`](/~https://github.com/rust-lang/libc/blob/HEAD/ci/build.sh) for +See [`ci/verify-build.sh`](/~https://github.com/rust-lang/libc/blob/HEAD/ci/verify-build.sh) for the platforms on which `libc` is guaranteed to build for each Rust toolchain. The test-matrix at [GitHub Actions] and [Cirrus CI] show the platforms in which `libc` tests are run. diff --git a/build.rs b/build.rs index 3ee2b406aaeb6..d085a3bb6f3ab 100644 --- a/build.rs +++ b/build.rs @@ -5,7 +5,7 @@ use std::{env, str}; // need to know all the possible cfgs that this script will set. If you need to set another cfg // make sure to add it to this list as well. const ALLOWED_CFGS: &'static [&'static str] = &[ - "emscripten_new_stat_abi", + "emscripten_old_stat_abi", "espidf_time32", "freebsd10", "freebsd11", @@ -75,9 +75,9 @@ fn main() { } match emcc_version_code() { - Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"), - // Non-Emscripten or version < 3.1.42. - Some(_) | None => (), + Some(v) if (v < 30142) => set_cfg("emscripten_old_stat_abi"), + // Non-Emscripten or version >= 3.1.42. + _ => (), } let linux_time_bits64 = env::var("RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64").is_ok(); diff --git a/ci/emscripten.sh b/ci/emscripten.sh index 0a4112e7e205e..e2f41937ddfc0 100755 --- a/ci/emscripten.sh +++ b/ci/emscripten.sh @@ -3,7 +3,7 @@ set -eux # Note: keep in sync with: -# /~https://github.com/rust-lang/rust/blob/master/src/ci/docker/scripts/emscripten.sh +# /~https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/platform-support/wasm32-unknown-emscripten.md#requirements emsdk_version=3.1.68 git clone /~https://github.com/emscripten-core/emsdk.git /emsdk-portable diff --git a/libc-test/build.rs b/libc-test/build.rs index 5f3316837fdfb..1edba8ef56a64 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -680,7 +680,7 @@ fn test_windows(target: &str) { // Just pass all these through, no need for a "struct" prefix "FILE" | "DIR" | "Dl_info" => ty.to_string(), - // FIXME: these don't exist: + // FIXME(windows): these don't exist: "time64_t" => "__time64_t".to_string(), "ssize_t" => "SSIZE_T".to_string(), @@ -712,7 +712,7 @@ fn test_windows(target: &str) { cfg.skip_type(move |name| match name { "SSIZE_T" if !gnu => true, "ssize_t" if !gnu => true, - // FIXME: The size and alignment of this type are incorrect + // FIXME(windows): The size and alignment of this type are incorrect "time_t" if gnu && i686 => true, _ => false, }); @@ -722,7 +722,7 @@ fn test_windows(target: &str) { return true; } match ty { - // FIXME: The size and alignment of this struct are incorrect + // FIXME(windows): The size and alignment of this struct are incorrect "timespec" if gnu && i686 => true, _ => false, } @@ -730,12 +730,12 @@ fn test_windows(target: &str) { cfg.skip_const(move |name| { match name { - // FIXME: API error: + // FIXME(windows): API error: // SIG_ERR type is "void (*)(int)", not "int" "SIG_ERR" | // Similar for SIG_DFL/IGN/GET/SGE/ACK "SIG_DFL" | "SIG_IGN" | "SIG_GET" | "SIG_SGE" | "SIG_ACK" => true, - // FIXME: newer windows-gnu environment on CI? + // FIXME(windows): newer windows-gnu environment on CI? "_O_OBTAIN_DIR" if gnu => true, _ => false, } @@ -745,7 +745,7 @@ fn test_windows(target: &str) { "CONTEXT" if field == "Fp" => true, _ => false, }); - // FIXME: All functions point to the wrong addresses? + // FIXME(windows): All functions point to the wrong addresses? cfg.skip_fn_ptrcheck(|_| true); cfg.skip_signededness(move |c| { @@ -864,6 +864,7 @@ fn test_solarish(target: &str) { "sched.h", "semaphore.h", "signal.h", + "spawn.h", "stddef.h", "stdint.h", "stdio.h", @@ -1041,7 +1042,7 @@ fn test_solarish(target: &str) { // are still ABI compatible. We can wait for the next major release // to be compliant with the new API. // - // FIXME: unskip these for next major release + // FIXME(solarish): unskip these for next major release "setpriority" | "personality" => true, // signal is defined in terms of sighandler_t, so ignore @@ -1076,7 +1077,7 @@ fn test_solarish(target: &str) { // excluded from the tests. "getifaddrs" if is_illumos => true, - // FIXME: Our API is unsound. The Rust API allows aliasing + // FIXME(ctest): Our API is unsound. The Rust API allows aliasing // pointers, but the C API requires pointers not to alias. // We should probably be at least using `&`/`&mut` here, see: // /~https://github.com/gnzlbg/ctest/issues/68 @@ -1222,7 +1223,7 @@ fn test_netbsd(target: &str) { return true; } match ty { - // FIXME: sighandler_t is crazy across platforms + // FIXME(netbsd): sighandler_t is crazy across platforms "sighandler_t" => true, _ => false, } @@ -1266,7 +1267,7 @@ fn test_netbsd(target: &str) { cfg.skip_fn(move |name| { match name { - // FIXME: netbsd 10 minimum + // FIXME(netbsd): netbsd 10 minimum "getentropy" | "getrandom" => true, "getrlimit" | "getrlimit64" | // non-int in 1st arg @@ -1405,7 +1406,7 @@ fn test_dragonflybsd(target: &str) { | "Elf64_Shdr" | "Elf32_Sym" | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr" | "Elf64_Chdr" => ty.to_string(), - // FIXME: OSX calls this something else + // FIXME(dragonflybsd): OSX calls this something else "sighandler_t" => "sig_t".to_string(), t if is_union => format!("union {}", t), @@ -1450,7 +1451,7 @@ fn test_dragonflybsd(target: &str) { return true; } match ty { - // FIXME: These are tested as part of the linux_fcntl tests since + // FIXME(dragonflybsd): These are tested as part of the linux_fcntl tests since // there are header conflicts when including them with all the other // structs. "termios2" => true, @@ -1814,7 +1815,7 @@ fn test_android(target: &str) { // Our stat *_nsec fields normally don't actually exist but are part // of a timeval struct s if s.ends_with("_nsec") && struct_.starts_with("stat") => s.to_string(), - // FIXME: appears that `epoll_event.data` is an union + // FIXME(union): appears that `epoll_event.data` is an union "u64" if struct_ == "epoll_event" => "data.u64".to_string(), // The following structs have a field called `type` in C, // but `type` is a Rust keyword, so these fields are translated @@ -1833,7 +1834,7 @@ fn test_android(target: &str) { cfg.skip_type(move |ty| { match ty { - // FIXME: `sighandler_t` type is incorrect, see: + // FIXME(android): `sighandler_t` type is incorrect, see: // /~https://github.com/rust-lang/libc/issues/1359 "sighandler_t" => true, @@ -1844,7 +1845,7 @@ fn test_android(target: &str) { "posix_spawn_file_actions_t" => true, "posix_spawnattr_t" => true, - // FIXME: "'__uint128' undeclared" in C + // FIXME(android): "'__uint128' undeclared" in C "__uint128" => true, _ => false, @@ -1867,12 +1868,12 @@ fn test_android(target: &str) { // These are tested in the `linux_elf.rs` file. "Elf64_Phdr" | "Elf32_Phdr" => true, - // FIXME: The type of `iv` has been changed. + // FIXME(android): The type of `iv` has been changed. "af_alg_iv" => true, - // FIXME: The size of struct has been changed: + // FIXME(android): The size of struct has been changed: "inotify_event" => true, - // FIXME: The field has been changed: + // FIXME(android): The field has been changed: "sockaddr_vm" => true, _ => false, @@ -1899,13 +1900,13 @@ fn test_android(target: &str) { // The `ARPHRD_CAN` is tested in the `linux_if_arp.rs` tests: "ARPHRD_CAN" => true, - // FIXME: deprecated: not available in any header + // FIXME(deprecated): deprecated: not available in any header // See: /~https://github.com/rust-lang/libc/issues/1356 "ENOATTR" => true, - // FIXME: still necessary? + // FIXME(android): still necessary? "SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, // sighandler_t weirdness - // FIXME: deprecated - removed in glibc 2.26 + // FIXME(deprecated): deprecated - removed in glibc 2.26 "SIGUNUSED" => true, // Needs a newer Android SDK for the definition @@ -1914,7 +1915,7 @@ fn test_android(target: &str) { // Requires Linux kernel 5.6 "VMADDR_CID_LOCAL" => true, - // FIXME: conflicts with standard C headers and is tested in + // FIXME(android): conflicts with standard C headers and is tested in // `linux_termios.rs` below: "BOTHER" => true, "IBSHIFT" => true, @@ -1944,7 +1945,7 @@ fn test_android(target: &str) { // kernel 6.2 minimum "TUN_F_USO4" | "TUN_F_USO6" | "IFF_NO_CARRIER" => true, - // FIXME: NDK r22 minimum required + // FIXME(android): NDK r22 minimum required | "FDB_NOTIFY_BIT" | "FDB_NOTIFY_INACTIVE_BIT" | "IFLA_ALT_IFNAME" @@ -1957,16 +1958,16 @@ fn test_android(target: &str) { | "NFEA_DONT_REFRESH" | "NFEA_UNSPEC" => true, - // FIXME: NDK r23 minimum required + // FIXME(android): NDK r23 minimum required | "IFLA_PARENT_DEV_BUS_NAME" | "IFLA_PARENT_DEV_NAME" => true, - // FIXME: NDK r25 minimum required + // FIXME(android): NDK r25 minimum required | "IFLA_GRO_MAX_SIZE" | "NDA_FLAGS_EXT" | "NTF_EXT_MANAGED" => true, - // FIXME: NDK above r25 required + // FIXME(android): NDK above r25 required | "IFLA_ALLMULTI" | "IFLA_DEVLINK_PORT" | "IFLA_GRO_IPV4_MAX_SIZE" @@ -1980,7 +1981,7 @@ fn test_android(target: &str) { | "NTF_EXT_LOCKED" | "ALG_SET_DRBG_ENTROPY" => true, - // FIXME: Something has been changed on r26b: + // FIXME(android): Something has been changed on r26b: | "IPPROTO_MAX" | "NFNL_SUBSYS_COUNT" | "NF_NETDEV_NUMHOOKS" @@ -1988,10 +1989,10 @@ fn test_android(target: &str) { | "SW_MAX" | "SW_CNT" => true, - // FIXME: aarch64 env cannot find it: + // FIXME(android): aarch64 env cannot find it: | "PTRACE_GETREGS" | "PTRACE_SETREGS" if aarch64 => true, - // FIXME: The value has been changed on r26b: + // FIXME(android): The value has been changed on r26b: | "SYS_syscalls" if aarch64 => true, // From ``. @@ -2023,6 +2024,9 @@ fn test_android(target: &str) { | "PF_BLOCK_TS" | "PF_SUSPEND_TASK" => true, + // FIXME(android): Requires >= 6.12 kernel headers. + "SOF_TIMESTAMPING_OPT_RX_FILTER" => true, + _ => false, } }); @@ -2030,7 +2034,7 @@ fn test_android(target: &str) { cfg.skip_fn(move |name| { // skip those that are manually verified match name { - // FIXME: for unknown reasons linker unable to find "fexecve" + // FIXME(android): for unknown reasons linker unable to find "fexecve" "fexecve" => true, // There are two versions of the sterror_r function, see @@ -2084,7 +2088,7 @@ fn test_android(target: &str) { // Added in API level 26, but some tests use level 24. "getdomainname" | "setdomainname" => true, - // FIXME: bad function pointers: + // FIXME(android): bad function pointers: "isalnum" | "isalpha" | "iscntrl" | "isdigit" | "isgraph" | "islower" | "isprint" | "ispunct" | "isspace" | "isupper" | "isxdigit" | "isblank" | "tolower" | "toupper" => true, @@ -2100,12 +2104,12 @@ fn test_android(target: &str) { (struct_ == "sigevent" && field == "sigev_value") || // this one is an anonymous union (struct_ == "ff_effect" && field == "u") || - // FIXME: `sa_sigaction` has type `sighandler_t` but that type is + // FIXME(android): `sa_sigaction` has type `sighandler_t` but that type is // incorrect, see: /~https://github.com/rust-lang/libc/issues/1359 (struct_ == "sigaction" && field == "sa_sigaction") || // signalfd had SIGSYS fields added in Android 4.19, but CI does not have that version yet. (struct_ == "signalfd_siginfo" && field == "ssi_call_addr") || - // FIXME: Seems the type has been changed on NDK r26b + // FIXME(android): Seems the type has been changed on NDK r26b (struct_ == "flock64" && (field == "l_start" || field == "l_len")) }); @@ -2255,6 +2259,7 @@ fn test_freebsd(target: &str) { "sys/thr.h", "sys/time.h", [freebsd14 || freebsd15]:"sys/timerfd.h", + [freebsd13 || freebsd14 || freebsd15]:"dev/evdev/input.h", "sys/times.h", "sys/timex.h", "sys/types.h", @@ -2299,7 +2304,7 @@ fn test_freebsd(target: &str) { | "devstat_match_flags" | "devstat_priority" => ty.to_string(), - // FIXME: /~https://github.com/rust-lang/libc/issues/1273 + // FIXME(freebsd): /~https://github.com/rust-lang/libc/issues/1273 "sighandler_t" => "sig_t".to_string(), t if is_union => format!("union {}", t), @@ -2328,6 +2333,7 @@ fn test_freebsd(target: &str) { "type_" if struct_ == "rtprio" => "type".to_string(), "type_" if struct_ == "sockstat" => "type".to_string(), "type_" if struct_ == "devstat_match_table" => "type".to_string(), + "type_" if struct_ == "input_event" => "type".to_string(), s => s.to_string(), } }); @@ -2361,12 +2367,12 @@ fn test_freebsd(target: &str) { true } - // FIXME: These are deprecated - remove in a couple of releases. + // FIXME(deprecated): These are deprecated - remove in a couple of releases. // These constants were removed in FreeBSD 11 (svn r273250) but will // still be accepted and ignored at runtime. "MAP_RENAME" | "MAP_NORESERVE" => true, - // FIXME: This is deprecated - remove in a couple of releases. + // FIXME(deprecated): This is deprecated - remove in a couple of releases. // This was removed in FreeBSD 14 (git 1b4701fe1e8) and never // should've been used anywhere anyway. "TDF_UNUSED23" => true, @@ -2383,7 +2389,7 @@ fn test_freebsd(target: &str) { // Removed in FreeBSD 14 (git 7ff9ae90f0b) "IFF_NOGROUP" => true, - // FIXME: These are deprecated - remove in a couple of releases. + // FIXME(deprecated): These are deprecated - remove in a couple of releases. // These symbols are not stable across OS-versions. They were // changed for FreeBSD 14 in git revisions b62848b0c3f and // 2cf7870864e. @@ -2497,7 +2503,7 @@ fn test_freebsd(target: &str) { } // Added in FreeBSD 14. - "F_KINFO" => true, // FIXME: depends how frequent freebsd 14 is updated on CI, this addition went this week only. + "F_KINFO" => true, // FIXME(freebsd): depends how frequent freebsd 14 is updated on CI, this addition went this week only. "SHM_RENAME_NOREPLACE" | "SHM_RENAME_EXCHANGE" | "SHM_LARGEPAGE_ALLOC_DEFAULT" @@ -2553,11 +2559,11 @@ fn test_freebsd(target: &str) { // Added in FreeBSD 14 "IFCAP_NV" if Some(14) > freebsd_ver => true, - // FIXME: Removed in https://reviews.freebsd.org/D38574 and https://reviews.freebsd.org/D38822 + // FIXME(freebsd): Removed in https://reviews.freebsd.org/D38574 and https://reviews.freebsd.org/D38822 // We maybe should deprecate them once a stable release ships them. "IP_BINDMULTI" | "IP_RSS_LISTEN_BUCKET" => true, - // FIXME: Removed in https://reviews.freebsd.org/D39127. + // FIXME(freebsd): Removed in https://reviews.freebsd.org/D39127. "KERN_VNODE" => true, // Added in FreeBSD 14 @@ -2580,10 +2586,10 @@ fn test_freebsd(target: &str) { true } - // FIXME: Removed in FreeBSD 15: + // FIXME(freebsd): Removed in FreeBSD 15: "LOCAL_CONNWAIT" => true, - // FIXME: The values has been changed in FreeBSD 15: + // FIXME(freebsd): The values has been changed in FreeBSD 15: "CLOCK_BOOTTIME" if Some(15) <= freebsd_ver => true, // Added in FreeBSD 14.0 @@ -2637,7 +2643,7 @@ fn test_freebsd(target: &str) { | "sctp_send_failed_event" | "sctp_stream_reset_event" => true, - // FIXME: Changed in FreeBSD 15 + // FIXME(freebsd): Changed in FreeBSD 15 "tcp_info" | "sockstat" if Some(15) >= freebsd_ver => true, _ => false, @@ -2655,7 +2661,7 @@ fn test_freebsd(target: &str) { // Therefore the function pointer comparison does not make sense for it. "uname" => true, - // FIXME: Our API is unsound. The Rust API allows aliasing + // FIXME(ctest): Our API is unsound. The Rust API allows aliasing // pointers, but the C API requires pointers not to alias. // We should probably be at least using `&`/`&mut` here, see: // /~https://github.com/gnzlbg/ctest/issues/68 @@ -2718,7 +2724,7 @@ fn test_freebsd(target: &str) { cfg.skip_field(move |struct_, field| { match (struct_, field) { - // FIXME: `sa_sigaction` has type `sighandler_t` but that type is + // FIXME(freebsd): `sa_sigaction` has type `sighandler_t` but that type is // incorrect, see: /~https://github.com/rust-lang/libc/issues/1359 ("sigaction", "sa_sigaction") => true, @@ -2750,7 +2756,7 @@ fn test_freebsd(target: &str) { // anonymous struct ("devstat", "dev_links") => true, - // FIXME: structs too complicated to bind for now... + // FIXME(freebsd): structs too complicated to bind for now... ("kinfo_proc", "ki_paddr") => true, ("kinfo_proc", "ki_addr") => true, ("kinfo_proc", "ki_tracep") => true, @@ -2794,7 +2800,7 @@ fn test_emscripten(target: &str) { assert!(target.contains("emscripten")); let mut cfg = ctest_cfg(); - cfg.define("_GNU_SOURCE", None); // FIXME: ?? + cfg.define("_GNU_SOURCE", None); // FIXME(emscripten): ?? headers! { cfg: "ctype.h", @@ -2910,7 +2916,7 @@ fn test_emscripten(target: &str) { cfg.skip_type(move |ty| { match ty { // sighandler_t is crazy across platforms - // FIXME: is this necessary? + // FIXME(emscripten): is this necessary? "sighandler_t" => true, // No epoll support @@ -2931,7 +2937,7 @@ fn test_emscripten(target: &str) { // This is actually a union, not a struct "sigval" => true, - // FIXME: Investigate why the test fails. + // FIXME(emscripten): Investigate why the test fails. // Skip for now to unblock CI. "pthread_condattr_t" => true, "pthread_mutexattr_t" => true, @@ -4115,29 +4121,29 @@ fn test_linux(target: &str) { | "CANXL_XLF" => true, - // FIXME: Parts of netfilter/nfnetlink*.h require more recent kernel headers: + // FIXME(linux): Parts of netfilter/nfnetlink*.h require more recent kernel headers: | "RTNLGRP_MCTP_IFADDR" // linux v5.17+ | "RTNLGRP_TUNNEL" // linux v5.18+ | "RTNLGRP_STATS" // linux v5.18+ => true, - // FIXME: The below is no longer const in glibc 2.34: + // FIXME(linux): The below is no longer const in glibc 2.34: // /~https://github.com/bminor/glibc/commit/5d98a7dae955bafa6740c26eaba9c86060ae0344 | "PTHREAD_STACK_MIN" | "SIGSTKSZ" | "MINSIGSTKSZ" if gnu => true, - // FIXME: Linux >= 5.16: + // FIXME(linux): Linux >= 5.16: // /~https://github.com/torvalds/linux/commit/42df6e1d221dddc0f2acf2be37e68d553ad65f96 "NF_NETDEV_EGRESS" if sparc64 => true, // value changed "NF_NETDEV_NUMHOOKS" if sparc64 => true, - // FIXME: requires Linux >= v5.8 + // FIXME(linux): requires Linux >= v5.8 "IF_LINK_MODE_TESTING" if sparc64 => true, - // FIXME: Requires >= 6.3 kernel headers + // FIXME(linux): Requires >= 6.3 kernel headers "MFD_EXEC" | "MFD_NOEXEC_SEAL" if sparc64 => true, // kernel 6.1 minimum @@ -4146,7 +4152,7 @@ fn test_linux(target: &str) { // kernel 6.2 minimum "TUN_F_USO4" | "TUN_F_USO6" | "IFF_NO_CARRIER" => true, - // FIXME: Requires more recent kernel headers + // FIXME(linux): Requires more recent kernel headers | "IFLA_PARENT_DEV_NAME" // linux v5.13+ | "IFLA_PARENT_DEV_BUS_NAME" // linux v5.13+ | "IFLA_GRO_MAX_SIZE" // linux v5.16+ @@ -4159,10 +4165,10 @@ fn test_linux(target: &str) { // kernel 6.5 minimum "MOVE_MOUNT_BENEATH" => true, - // FIXME: Requires linux 6.1 + // FIXME(linux): Requires linux 6.1 "ALG_SET_KEY_BY_KEY_SERIAL" | "ALG_SET_DRBG_ENTROPY" => true, - // FIXME: Requires more recent kernel headers + // FIXME(linux): Requires more recent kernel headers | "FAN_FS_ERROR" // linux v5.16+ | "FAN_RENAME" // linux v5.17+ | "FAN_REPORT_TARGET_FID" // linux v5.17+ @@ -4190,10 +4196,10 @@ fn test_linux(target: &str) { | "FAN_EPIDFD" if musl => true, - // FIXME: Requires linux 6.5 + // FIXME(linux): Requires linux 6.5 "NFT_MSG_MAX" => true, - // FIXME: Requires >= 6.6 kernel headers. + // FIXME(linux): Requires >= 6.6 kernel headers. "XDP_USE_SG" | "XDP_PKT_CONTD" => @@ -4201,7 +4207,7 @@ fn test_linux(target: &str) { true } - // FIXME: Requires >= 6.8 kernel headers. + // FIXME(linux): Requires >= 6.8 kernel headers. "XDP_UMEM_TX_SW_CSUM" | "XDP_TXMD_FLAGS_TIMESTAMP" | "XDP_TXMD_FLAGS_CHECKSUM" @@ -4211,20 +4217,20 @@ fn test_linux(target: &str) { true } - // FIXME: Requires >= 6.11 kernel headers. + // FIXME(linux): Requires >= 6.11 kernel headers. "XDP_UMEM_TX_METADATA_LEN" => { true } - // FIXME: Requires >= 6.6 kernel headers. + // FIXME(linux): Requires >= 6.6 kernel headers. "SYS_fchmodat2" => true, - // FIXME: Requires >= 6.10 kernel headers. + // FIXME(linux): Requires >= 6.10 kernel headers. "SYS_mseal" => true, - // FIXME: seems to not be available all the time (from : + // FIXME(linux): seems to not be available all the time (from : "PF_VCPU" | "PF_IDLE" | "PF_EXITING" @@ -4253,13 +4259,19 @@ fn test_linux(target: &str) { | "PF_BLOCK_TS" | "PF_SUSPEND_TASK" => true, - // FIXME: Requires >= 6.9 kernel headers. + // FIXME(linux): Requires >= 6.9 kernel headers. "EPIOCSPARAMS" | "EPIOCGPARAMS" => true, - // FIXME: Requires >= 6.11 kernel headers. + // FIXME(linux): Requires >= 6.11 kernel headers. "MAP_DROPPABLE" => true, + // FIXME(linux): Requires >= 6.2 kernel headers. + "SOF_TIMESTAMPING_OPT_ID_TCP" => true, + + // FIXME(linux): Requires >= 6.12 kernel headers. + "SOF_TIMESTAMPING_OPT_RX_FILTER" => true, + _ => false, } }); @@ -4285,7 +4297,7 @@ fn test_linux(target: &str) { // test the XSI version below. "strerror_r" => true, - // FIXME: Our API is unsound. The Rust API allows aliasing + // FIXME(linux): Our API is unsound. The Rust API allows aliasing // pointers, but the C API requires pointers not to alias. // We should probably be at least using `&`/`&mut` here, see: // /~https://github.com/gnzlbg/ctest/issues/68 @@ -4296,10 +4308,10 @@ fn test_linux(target: &str) { // Needs glibc 2.35 or later. "posix_spawn_file_actions_addtcsetpgrp_np" if gnu && sparc64 => true, - // FIXME: Deprecated since glibc 2.30. Remove fn once upstream does. + // FIXME(linux): Deprecated since glibc 2.30. Remove fn once upstream does. "sysctl" if gnu => true, - // FIXME: It now takes c_void instead of timezone since glibc 2.31. + // FIXME(linux): It now takes c_void instead of timezone since glibc 2.31. "gettimeofday" if gnu => true, // These are all implemented as static inline functions in uclibc, so @@ -4327,7 +4339,7 @@ fn test_linux(target: &str) { // assume it's a int instead. "getnameinfo" if uclibc => true, - // FIXME: This needs musl 1.2.2 or later. + // FIXME(musl): This needs musl 1.2.2 or later. "gettid" if musl => true, // Needs glibc 2.33 or later. @@ -4363,7 +4375,7 @@ fn test_linux(target: &str) { "posix_basename" if gnu => true, "gnu_basename" if gnu => true, - // FIXME: function pointers changed since Ubuntu 23.10 + // FIXME(linux): function pointers changed since Ubuntu 23.10 "strtol" | "strtoll" | "strtoul" | "strtoull" | "fscanf" | "scanf" | "sscanf" => true, // Added in musl 1.2.5 @@ -4425,7 +4437,7 @@ fn test_linux(target: &str) { field == "ssi_syscall" || field == "ssi_call_addr" || field == "ssi_arch")) || - // FIXME: After musl 1.1.24, it have only one field `sched_priority`, + // FIXME(musl): After musl 1.1.24, it have only one field `sched_priority`, // while other fields become reserved. (struct_ == "sched_param" && [ "sched_ss_low_priority", @@ -4433,11 +4445,11 @@ fn test_linux(target: &str) { "sched_ss_init_budget", "sched_ss_max_repl", ].contains(&field) && musl) || - // FIXME: After musl 1.1.24, the type becomes `int` instead of `unsigned short`. + // FIXME(musl): After musl 1.1.24, the type becomes `int` instead of `unsigned short`. (struct_ == "ipc_perm" && field == "__seq" && aarch64_musl) || // glibc uses unnamed fields here and Rust doesn't support that yet (struct_ == "timex" && field.starts_with("__unused")) || - // FIXME: It now takes mode_t since glibc 2.31 on some targets. + // FIXME(linux): It now takes mode_t since glibc 2.31 on some targets. (struct_ == "ipc_perm" && field == "mode" && ((x86_64 || i686 || arm || riscv64) && gnu || x86_64_gnux32) ) || @@ -4486,9 +4498,9 @@ fn test_linux(target: &str) { }); cfg.skip_roundtrip(move |s| match s { - // FIXME: + // FIXME(1.0): "mcontext_t" if s390x => true, - // FIXME: This is actually a union. + // FIXME(union): This is actually a union. "fpreg_t" if s390x => true, // The test doesn't work on some env: @@ -4522,7 +4534,7 @@ fn test_linux(target: &str) { "fanotify_event_info_fid" => true, "cmsghdr" => true, - // FIXME: the call ABI of max_align_t is incorrect on these platforms: + // FIXME(linux): the call ABI of max_align_t is incorrect on these platforms: "max_align_t" if i686 || ppc64 => true, _ => false, @@ -4853,13 +4865,13 @@ fn test_haiku(target: &str) { return true; } match ty { - // FIXME: actually a union + // FIXME(union): actually a union "sigval" => true, - // FIXME: locale_t does not exist on Haiku + // FIXME(haiku): locale_t does not exist on Haiku "locale_t" => true, - // FIXME: rusage has a different layout on Haiku + // FIXME(haiku): rusage has a different layout on Haiku "rusage" => true, - // FIXME?: complains that rust aligns on 4 byte boundary, but + // FIXME(haiku): complains that rust aligns on 4 byte boundary, but // Haiku does not align it at all. "in6_addr" => true, // The d_name attribute is an array of 1 on Haiku, with the @@ -4884,7 +4896,7 @@ fn test_haiku(target: &str) { cfg.skip_type(move |ty| { match ty { - // FIXME: locale_t does not exist on Haiku + // FIXME(haiku): locale_t does not exist on Haiku "locale_t" => true, // These cause errors, to be reviewed in the future "sighandler_t" => true, @@ -4899,7 +4911,7 @@ fn test_haiku(target: &str) { cfg.skip_fn(move |name| { // skip those that are manually verified match name { - // FIXME: does not exist on haiku + // FIXME(haiku): does not exist on haiku "open_wmemstream" => true, "mlockall" | "munlockall" => true, "tcgetsid" => true, @@ -4923,7 +4935,7 @@ fn test_haiku(target: &str) { cfg.skip_const(move |name| { match name { - // FIXME: these constants do not exist on Haiku + // FIXME(haiku): these constants do not exist on Haiku "DT_UNKNOWN" | "DT_FIFO" | "DT_CHR" | "DT_DIR" | "DT_BLK" | "DT_REG" | "DT_LNK" | "DT_SOCK" => true, "USRQUOTA" | "GRPQUOTA" => true, @@ -4949,7 +4961,7 @@ fn test_haiku(target: &str) { cfg.skip_field(move |struct_, field| { match (struct_, field) { - // FIXME: the stat struct actually has timespec members, whereas + // FIXME(time): the stat struct actually has timespec members, whereas // the current representation has these unpacked. ("stat", "st_atime") => true, ("stat", "st_atime_nsec") => true, @@ -4979,7 +4991,7 @@ fn test_haiku(target: &str) { }); cfg.skip_roundtrip(move |s| match s { - // FIXME: for some reason the roundtrip check fails for cpu_info + // FIXME(1.0): for some reason the roundtrip check fails for cpu_info "cpu_info" => true, _ => false, }); diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index e117113846770..1d911471133e9 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -2385,9 +2385,12 @@ SOCK_RAW SOCK_RDM SOCK_SEQPACKET SOCK_STREAM +SOF_TIMESTAMPING_BIND_PHC SOF_TIMESTAMPING_OPT_CMSG SOF_TIMESTAMPING_OPT_ID +SOF_TIMESTAMPING_OPT_ID_TCP SOF_TIMESTAMPING_OPT_PKTINFO +SOF_TIMESTAMPING_OPT_RX_FILTER SOF_TIMESTAMPING_OPT_STATS SOF_TIMESTAMPING_OPT_TSONLY SOF_TIMESTAMPING_OPT_TX_SWHW diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index b4f770c571dd2..8a510ec257f29 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -2019,6 +2019,8 @@ ifconf ifreq in6_pktinfo initgroups +input_absinfo +input_event ip_mreqn ipc_perm jail diff --git a/libc-test/semver/illumos.txt b/libc-test/semver/illumos.txt index 433a6a1816240..b39aba51d1b5f 100644 --- a/libc-test/semver/illumos.txt +++ b/libc-test/semver/illumos.txt @@ -14,8 +14,10 @@ POSIX_FADV_NORMAL POSIX_FADV_RANDOM POSIX_FADV_SEQUENTIAL POSIX_FADV_WILLNEED +POSIX_SPAWN_SETSID posix_fadvise posix_fallocate +posix_spawn_file_actions_addfchdir_np pthread_attr_get_np pthread_attr_getstackaddr pthread_attr_setstack diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 5a6bbc7f7e56a..2d6687c8a7170 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -2898,9 +2898,12 @@ SOCK_NONBLOCK SOCK_PACKET SOCK_RAW SOCK_RDM +SOF_TIMESTAMPING_BIND_PHC SOF_TIMESTAMPING_OPT_CMSG SOF_TIMESTAMPING_OPT_ID +SOF_TIMESTAMPING_OPT_ID_TCP SOF_TIMESTAMPING_OPT_PKTINFO +SOF_TIMESTAMPING_OPT_RX_FILTER SOF_TIMESTAMPING_OPT_STATS SOF_TIMESTAMPING_OPT_TSONLY SOF_TIMESTAMPING_OPT_TX_SWHW diff --git a/libc-test/semver/solarish.txt b/libc-test/semver/solarish.txt index 5603201070f39..809347c5c4e36 100644 --- a/libc-test/semver/solarish.txt +++ b/libc-test/semver/solarish.txt @@ -15,6 +15,16 @@ LIO_READ LIO_WAIT LIO_WRITE PIPE_BUF +POSIX_SPAWN_NOEXECERR_NP +POSIX_SPAWN_NOSIGCHLD_NP +POSIX_SPAWN_RESETIDS +POSIX_SPAWN_SETPGROUP +POSIX_SPAWN_SETSCHEDPARAM +POSIX_SPAWN_SETSCHEDULER +POSIX_SPAWN_SETSIGDEF +POSIX_SPAWN_SETSIGIGN_NP +POSIX_SPAWN_SETSIGMASK +POSIX_SPAWN_WAITPID_NP SIGEV_PORT SIGRTMAX SIGRTMIN @@ -37,5 +47,32 @@ bind in6_pktinfo in_pktinfo lio_listio +posix_spawn +posix_spawn_file_actions_addchdir +posix_spawn_file_actions_addchdir_np +posix_spawn_file_actions_addclose +posix_spawn_file_actions_addclosefrom_np +posix_spawn_file_actions_adddup2 +posix_spawn_file_actions_addfchdir +posix_spawn_file_actions_addopen +posix_spawn_file_actions_destroy +posix_spawn_file_actions_init +posix_spawnattr_destroy +posix_spawnattr_getflags +posix_spawnattr_getpgroup +posix_spawnattr_getschedparam +posix_spawnattr_getschedpolicy +posix_spawnattr_getsigdefault +posix_spawnattr_getsigignore_np +posix_spawnattr_getsigmask +posix_spawnattr_init +posix_spawnattr_setflags +posix_spawnattr_setpgroup +posix_spawnattr_setschedparam +posix_spawnattr_setschedpolicy +posix_spawnattr_setsigdefault +posix_spawnattr_setsigignore_np +posix_spawnattr_setsigmask +posix_spawnp recvmsg sendmsg diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index 1b3ce259cb89a..7993e93061b27 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -7,16 +7,6 @@ use crate::prelude::*; // PUB_TYPE -pub type c_schar = i8; -pub type c_uchar = u8; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_int = i32; -pub type c_uint = u32; -pub type c_float = f32; -pub type c_double = f64; -pub type c_longlong = i64; -pub type c_ulonglong = u64; pub type intmax_t = i64; pub type uintmax_t = u64; @@ -88,9 +78,6 @@ pub type fsblkcnt_t = c_ulonglong; pub type fsfilcnt_t = c_ulonglong; pub type rlim_t = c_ulonglong; -pub type c_long = i64; -pub type c_ulong = u64; - // FIXME(fuchsia): why are these uninhabited types? that seems... wrong? // Presumably these should be `()` or an `extern type` (when that stabilizes). #[cfg_attr(feature = "extra_traits", derive(Debug))] diff --git a/src/fuchsia/x86_64.rs b/src/fuchsia/x86_64.rs index ffff3a78b5ed5..a184539e28277 100644 --- a/src/fuchsia/x86_64.rs +++ b/src/fuchsia/x86_64.rs @@ -102,7 +102,7 @@ cfg_if! { .field("uc_stack", &self.uc_stack) .field("uc_mcontext", &self.uc_mcontext) .field("uc_sigmask", &self.uc_sigmask) - // FIXME: .field("__private", &self.__private) + // FIXME(debug): .field("__private", &self.__private) .finish() } } diff --git a/src/hermit.rs b/src/hermit.rs index 03947bc01ade5..65d0bf374d8cd 100644 --- a/src/hermit.rs +++ b/src/hermit.rs @@ -2,24 +2,11 @@ use crate::prelude::*; -pub type c_schar = i8; -pub type c_uchar = u8; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_int = i32; -pub type c_uint = u32; -pub type c_long = i64; -pub type c_ulong = u64; -pub type c_longlong = i64; -pub type c_ulonglong = u64; pub type intmax_t = i64; pub type uintmax_t = u64; pub type intptr_t = isize; pub type uintptr_t = usize; -pub type c_float = f32; -pub type c_double = f64; - pub type size_t = usize; pub type ssize_t = isize; pub type ptrdiff_t = isize; diff --git a/src/lib.rs b/src/lib.rs index bfbfb34415c3e..255f4550056ce 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,130 +38,98 @@ cfg_if! { pub use core::ffi::c_void; -cfg_if! { - // This configuration comes from `rust-lang/rust` in `library/core/src/ffi/mod.rs`. - if #[cfg(all( - not(windows), - // FIXME(ctest): just use `target_vendor` = "apple"` once `ctest` supports it - not(any( - target_os = "macos", - target_os = "ios", - target_os = "tvos", - target_os = "watchos", - target_os = "visionos", - )), - any( - target_arch = "aarch64", - target_arch = "arm", - target_arch = "csky", - target_arch = "hexagon", - target_arch = "msp430", - target_arch = "powerpc", - target_arch = "powerpc64", - target_arch = "riscv64", - target_arch = "riscv32", - target_arch = "s390x", - target_arch = "xtensa", - ) - ))] { - pub type c_char = u8; - } else { - pub type c_char = i8; - } -} - cfg_if! { if #[cfg(windows)] { - mod fixed_width_ints; - pub use crate::fixed_width_ints::*; + mod primitives; + pub use crate::primitives::*; mod windows; pub use crate::windows::*; prelude!(); } else if #[cfg(target_os = "fuchsia")] { - mod fixed_width_ints; - pub use crate::fixed_width_ints::*; + mod primitives; + pub use crate::primitives::*; mod fuchsia; pub use crate::fuchsia::*; prelude!(); } else if #[cfg(target_os = "switch")] { - mod fixed_width_ints; - pub use fixed_width_ints::*; + mod primitives; + pub use primitives::*; mod switch; pub use switch::*; prelude!(); } else if #[cfg(target_os = "vxworks")] { - mod fixed_width_ints; - pub use crate::fixed_width_ints::*; + mod primitives; + pub use crate::primitives::*; mod vxworks; pub use crate::vxworks::*; prelude!(); } else if #[cfg(target_os = "solid_asp3")] { - mod fixed_width_ints; - pub use crate::fixed_width_ints::*; + mod primitives; + pub use crate::primitives::*; mod solid; pub use crate::solid::*; prelude!(); } else if #[cfg(unix)] { - mod fixed_width_ints; - pub use crate::fixed_width_ints::*; + mod primitives; + pub use crate::primitives::*; mod unix; pub use crate::unix::*; prelude!(); } else if #[cfg(target_os = "hermit")] { - mod fixed_width_ints; - pub use crate::fixed_width_ints::*; + mod primitives; + pub use crate::primitives::*; mod hermit; pub use crate::hermit::*; prelude!(); } else if #[cfg(target_os = "teeos")] { - mod fixed_width_ints; - pub use fixed_width_ints::*; + mod primitives; + pub use primitives::*; mod teeos; pub use teeos::*; prelude!(); } else if #[cfg(target_os = "trusty")] { - mod fixed_width_ints; - pub use crate::fixed_width_ints::*; + mod primitives; + pub use crate::primitives::*; mod trusty; pub use crate::trusty::*; prelude!(); } else if #[cfg(all(target_env = "sgx", target_vendor = "fortanix"))] { - mod fixed_width_ints; - pub use crate::fixed_width_ints::*; + mod primitives; + pub use crate::primitives::*; mod sgx; pub use crate::sgx::*; prelude!(); } else if #[cfg(any(target_env = "wasi", target_os = "wasi"))] { - mod fixed_width_ints; - pub use crate::fixed_width_ints::*; + mod primitives; + pub use crate::primitives::*; mod wasi; pub use crate::wasi::*; prelude!(); } else if #[cfg(target_os = "xous")] { - mod fixed_width_ints; - pub use crate::fixed_width_ints::*; + mod primitives; + pub use crate::primitives::*; mod xous; pub use crate::xous::*; diff --git a/src/fixed_width_ints.rs b/src/primitives.rs similarity index 72% rename from src/fixed_width_ints.rs rename to src/primitives.rs index 1900833ff78f9..78b14b52ef1f2 100644 --- a/src/fixed_width_ints.rs +++ b/src/primitives.rs @@ -1,6 +1,75 @@ -//! This module contains type aliases for C's fixed-width integer types . +//! This module contains type aliases for C's platform-specific types +//! and fixed-width integer types. //! -//! These aliases are deprecated: use the Rust types instead. +//! The platform-specific types definitions were taken from rust-lang/rust in +//! library/core/src/ffi/primitives.rs +//! +//! The fixed-width integer aliases are deprecated: use the Rust types instead. + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; + +pub type c_longlong = i64; +pub type c_ulonglong = u64; + +pub type c_float = f32; +pub type c_double = f64; + +cfg_if! { + if #[cfg(all( + not(windows), + // FIXME(ctest): just use `target_vendor` = "apple"` once `ctest` supports it + not(any( + target_os = "macos", + target_os = "ios", + target_os = "tvos", + target_os = "watchos", + target_os = "visionos", + )), + not(target_os = "vita"), + any( + target_arch = "aarch64", + target_arch = "arm", + target_arch = "csky", + target_arch = "hexagon", + target_arch = "msp430", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "riscv32", + target_arch = "riscv64", + target_arch = "s390x", + target_arch = "xtensa", + ) + ))] { + pub type c_char = u8; + } else { + // On every other target, c_char is signed. + pub type c_char = i8; + } +} + +cfg_if! { + if #[cfg(any(target_arch = "avr", target_arch = "msp430"))] { + pub type c_int = i16; + pub type c_uint = u16; + } else { + pub type c_int = i32; + pub type c_uint = u32; + } +} + +cfg_if! { + if #[cfg(all(target_pointer_width = "64", not(windows)))] { + pub type c_long = i64; + pub type c_ulong = u64; + } else { + // The minimal size of `long` in the C standard is 32 bits + pub type c_long = i32; + pub type c_ulong = u32; + } +} #[deprecated(since = "0.2.55", note = "Use i8 instead.")] pub type int8_t = i8; diff --git a/src/sgx.rs b/src/sgx.rs index 65eded63ad460..9cf9c6d3b41b8 100644 --- a/src/sgx.rs +++ b/src/sgx.rs @@ -1,15 +1,7 @@ //! SGX C types definition -pub type c_schar = i8; -pub type c_uchar = u8; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_int = i32; -pub type c_uint = u32; -pub type c_float = f32; -pub type c_double = f64; -pub type c_longlong = i64; -pub type c_ulonglong = u64; +use crate::prelude::*; + pub type intmax_t = i64; pub type uintmax_t = u64; @@ -19,8 +11,5 @@ pub type intptr_t = isize; pub type uintptr_t = usize; pub type ssize_t = isize; -pub type c_long = i64; -pub type c_ulong = u64; - pub const INT_MIN: c_int = -2147483648; pub const INT_MAX: c_int = 2147483647; diff --git a/src/solid/aarch64.rs b/src/solid/aarch64.rs index 630c7db54b55b..376783c8234ba 100644 --- a/src/solid/aarch64.rs +++ b/src/solid/aarch64.rs @@ -1,3 +1 @@ pub type wchar_t = u32; -pub type c_long = i64; -pub type c_ulong = u64; diff --git a/src/solid/arm.rs b/src/solid/arm.rs index 01fc7262f03e2..376783c8234ba 100644 --- a/src/solid/arm.rs +++ b/src/solid/arm.rs @@ -1,3 +1 @@ pub type wchar_t = u32; -pub type c_long = i32; -pub type c_ulong = u32; diff --git a/src/solid/mod.rs b/src/solid/mod.rs index 19c9b6aed344b..965c5bb1aa522 100644 --- a/src/solid/mod.rs +++ b/src/solid/mod.rs @@ -4,16 +4,6 @@ use crate::prelude::*; -pub type c_schar = i8; -pub type c_uchar = u8; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_int = i32; -pub type c_uint = u32; -pub type c_float = f32; -pub type c_double = f64; -pub type c_longlong = i64; -pub type c_ulonglong = u64; pub type intmax_t = i64; pub type uintmax_t = u64; diff --git a/src/switch.rs b/src/switch.rs index 1875ea81ad1ec..d965ff7005fb2 100644 --- a/src/switch.rs +++ b/src/switch.rs @@ -1,15 +1,5 @@ //! Switch C type definitions -pub type c_schar = i8; -pub type c_uchar = u8; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_int = i32; -pub type c_uint = u32; -pub type c_float = f32; -pub type c_double = f64; -pub type c_longlong = i64; -pub type c_ulonglong = u64; pub type intmax_t = i64; pub type uintmax_t = u64; @@ -20,8 +10,6 @@ pub type uintptr_t = usize; pub type ssize_t = isize; pub type off_t = i64; -pub type c_long = i64; -pub type c_ulong = u64; pub type wchar_t = u32; pub const INT_MIN: c_int = -2147483648; diff --git a/src/teeos/mod.rs b/src/teeos/mod.rs index 1ec2706cfdf76..9929e70e61e63 100644 --- a/src/teeos/mod.rs +++ b/src/teeos/mod.rs @@ -7,28 +7,8 @@ use crate::prelude::*; -pub type c_schar = i8; - -pub type c_uchar = u8; - -pub type c_short = i16; - -pub type c_ushort = u16; - -pub type c_int = i32; - -pub type c_uint = u32; - pub type c_bool = i32; -pub type c_float = f32; - -pub type c_double = f64; - -pub type c_longlong = i64; - -pub type c_ulonglong = u64; - pub type intmax_t = i64; pub type uintmax_t = u64; @@ -47,10 +27,6 @@ pub type pid_t = c_int; pub type wchar_t = u32; -pub type c_long = i64; - -pub type c_ulong = u64; - // long double in C means A float point value, which has 128bit length. // but some bit maybe not used, so the real length of long double could be 80(x86) or 128(power pc/IEEE) // this is different from f128(not stable and not included default) in Rust, so we use u128 for FFI(Rust to C). diff --git a/src/trusty.rs b/src/trusty.rs index db908d5c6d47a..7441aade0631e 100644 --- a/src/trusty.rs +++ b/src/trusty.rs @@ -4,26 +4,6 @@ pub type ssize_t = isize; pub type off_t = i64; -pub type c_schar = i8; -pub type c_uchar = u8; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_int = i32; -pub type c_uint = u32; - -cfg_if! { - if #[cfg(target_pointer_width = "32")] { - pub type c_long = i32; - pub type c_ulong = u32; - } else if #[cfg(target_pointer_width = "64")] { - pub type c_long = i64; - pub type c_ulong = u64; - } -} - -pub type c_longlong = i64; -pub type c_ulonglong = u64; - pub type c_uint8_t = u8; pub type c_uint16_t = u16; pub type c_uint32_t = u32; @@ -37,9 +17,6 @@ pub type c_int64_t = i64; pub type intptr_t = isize; pub type uintptr_t = usize; -pub type c_float = f32; -pub type c_double = f64; - pub type time_t = c_long; pub type clockid_t = c_int; diff --git a/src/unix/aix/powerpc64.rs b/src/unix/aix/powerpc64.rs index 921774611e299..fcb9e6edfafa7 100644 --- a/src/unix/aix/powerpc64.rs +++ b/src/unix/aix/powerpc64.rs @@ -1,9 +1,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; - s! { pub struct sigset_t { pub ss_set: [c_ulong; 4], diff --git a/src/unix/bsd/apple/b32/mod.rs b/src/unix/bsd/apple/b32/mod.rs index 70f8de79af7b6..3753ffb085907 100644 --- a/src/unix/bsd/apple/b32/mod.rs +++ b/src/unix/bsd/apple/b32/mod.rs @@ -2,8 +2,6 @@ use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; pub type boolean_t = c_int; s! { @@ -47,7 +45,7 @@ s! { } pub struct malloc_zone_t { - __private: [crate::uintptr_t; 18], // FIXME: keeping private for now + __private: [crate::uintptr_t; 18], // FIXME(macos): keeping private for now } } @@ -86,7 +84,7 @@ cfg_if! { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("pthread_attr_t") .field("__sig", &self.__sig) - // FIXME: .field("__opaque", &self.__opaque) + // FIXME(debug): .field("__opaque", &self.__opaque) .finish() } } diff --git a/src/unix/bsd/apple/b64/aarch64/mod.rs b/src/unix/bsd/apple/b64/aarch64/mod.rs index 60b9d4bb4ce40..e300b76ae8228 100644 --- a/src/unix/bsd/apple/b64/aarch64/mod.rs +++ b/src/unix/bsd/apple/b64/aarch64/mod.rs @@ -5,7 +5,7 @@ pub type mcontext_t = *mut __darwin_mcontext64; s! { pub struct malloc_zone_t { - __private: [crate::uintptr_t; 18], // FIXME: needs arm64 auth pointers support + __private: [crate::uintptr_t; 18], // FIXME(macos): needs arm64 auth pointers support } pub struct ucontext_t { diff --git a/src/unix/bsd/apple/b64/mod.rs b/src/unix/bsd/apple/b64/mod.rs index b09bcb9dad332..2bd682313428e 100644 --- a/src/unix/bsd/apple/b64/mod.rs +++ b/src/unix/bsd/apple/b64/mod.rs @@ -2,9 +2,6 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; - s! { pub struct timeval32 { pub tv_sec: i32, @@ -80,7 +77,7 @@ cfg_if! { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("pthread_attr_t") .field("__sig", &self.__sig) - // FIXME: .field("__opaque", &self.__opaque) + // FIXME(debug): .field("__opaque", &self.__opaque) .finish() } } diff --git a/src/unix/bsd/apple/b64/x86_64/mod.rs b/src/unix/bsd/apple/b64/x86_64/mod.rs index ea738497e98de..aa5ab85c0268b 100644 --- a/src/unix/bsd/apple/b64/x86_64/mod.rs +++ b/src/unix/bsd/apple/b64/x86_64/mod.rs @@ -106,7 +106,7 @@ s! { } pub struct malloc_introspection_t { - _private: [crate::uintptr_t; 16], // FIXME: keeping private for now + _private: [crate::uintptr_t; 16], // FIXME(macos): keeping private for now } pub struct malloc_zone_t { diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index ede2fc0641d9c..584d341192c13 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -361,7 +361,7 @@ s! { } pub struct sigaction { - // FIXME: this field is actually a union + // FIXME(union): this field is actually a union pub sa_sigaction: crate::sighandler_t, pub sa_mask: sigset_t, pub sa_flags: c_int, @@ -1304,9 +1304,9 @@ s_no_extra_traits! { pub shm_lpid: crate::pid_t, pub shm_cpid: crate::pid_t, pub shm_nattch: crate::shmatt_t, - pub shm_atime: crate::time_t, // FIXME: 64-bit wrong align => wrong offset - pub shm_dtime: crate::time_t, // FIXME: 64-bit wrong align => wrong offset - pub shm_ctime: crate::time_t, // FIXME: 64-bit wrong align => wrong offset + pub shm_atime: crate::time_t, // FIXME(macos): 64-bit wrong align => wrong offset + pub shm_dtime: crate::time_t, // FIXME(macos): 64-bit wrong align => wrong offset + pub shm_ctime: crate::time_t, // FIXME(macos): 64-bit wrong align => wrong offset // FIXME: 64-bit wrong align => wrong offset: pub shm_internal: *mut c_void, } @@ -1891,7 +1891,7 @@ cfg_if! { .field("pth_curpri", &self.pth_curpri) .field("pth_priority", &self.pth_priority) .field("pth_maxpriority", &self.pth_maxpriority) - // FIXME: .field("pth_name", &self.pth_name) + // FIXME(debug): .field("pth_name", &self.pth_name) .finish() } } @@ -1957,8 +1957,8 @@ cfg_if! { .field("f_fssubtype", &self.f_fssubtype) .field("f_fstypename", &self.f_fstypename) .field("f_type", &self.f_type) - // FIXME: .field("f_mntonname", &self.f_mntonname) - // FIXME: .field("f_mntfromname", &self.f_mntfromname) + // FIXME(debug): .field("f_mntonname", &self.f_mntonname) + // FIXME(debug): .field("f_mntfromname", &self.f_mntfromname) .field("f_reserved", &self.f_reserved) .finish() } @@ -2008,7 +2008,7 @@ cfg_if! { .field("d_reclen", &self.d_reclen) .field("d_namlen", &self.d_namlen) .field("d_type", &self.d_type) - // FIXME: .field("d_name", &self.d_name) + // FIXME(debug): .field("d_name", &self.d_name) .finish() } } @@ -2037,7 +2037,7 @@ cfg_if! { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("pthread_rwlock_t") .field("__sig", &self.__sig) - // FIXME: .field("__opaque", &self.__opaque) + // FIXME(debug): .field("__opaque", &self.__opaque) .finish() } } @@ -2065,7 +2065,7 @@ cfg_if! { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("pthread_mutex_t") .field("__sig", &self.__sig) - // FIXME: .field("__opaque", &self.__opaque) + // FIXME(debug): .field("__opaque", &self.__opaque) .finish() } } @@ -2094,7 +2094,7 @@ cfg_if! { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("pthread_cond_t") .field("__sig", &self.__sig) - // FIXME: .field("__opaque", &self.__opaque) + // FIXME(debug): .field("__opaque", &self.__opaque) .finish() } } @@ -2133,7 +2133,7 @@ cfg_if! { .field("ss_family", &self.ss_family) .field("__ss_pad1", &self.__ss_pad1) .field("__ss_align", &self.__ss_align) - // FIXME: .field("__ss_pad2", &self.__ss_pad2) + // FIXME(debug): .field("__ss_pad2", &self.__ss_pad2) .finish() } } @@ -2173,13 +2173,13 @@ cfg_if! { impl fmt::Debug for utmpx { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("utmpx") - // FIXME: .field("ut_user", &self.ut_user) + // FIXME(debug): .field("ut_user", &self.ut_user) .field("ut_id", &self.ut_id) .field("ut_line", &self.ut_line) .field("ut_pid", &self.ut_pid) .field("ut_type", &self.ut_type) .field("ut_tv", &self.ut_tv) - // FIXME: .field("ut_host", &self.ut_host) + // FIXME(debug): .field("ut_host", &self.ut_host) .field("ut_pad", &self.ut_pad) .finish() } @@ -2421,7 +2421,7 @@ cfg_if! { .field("pth_curpri", &self.pth_curpri) .field("pth_priority", &self.pth_priority) .field("pth_maxpriority", &self.pth_maxpriority) - // FIXME: .field("pth_name", &self.pth_name) + // FIXME(debug): .field("pth_name", &self.pth_name) .finish() } } diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 7ce4fdf854d39..17a28e07cdef2 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -10,8 +10,6 @@ pub type nlink_t = u32; pub type blksize_t = i64; pub type clockid_t = c_ulong; -pub type c_long = i64; -pub type c_ulong = u64; pub type time_t = i64; pub type suseconds_t = i64; @@ -562,7 +560,7 @@ cfg_if! { .field("ut_name", &self.ut_name) .field("ut_id", &self.ut_id) .field("ut_line", &self.ut_line) - // FIXME: .field("ut_host", &self.ut_host) + // FIXME(debug): .field("ut_host", &self.ut_host) .field("ut_unused", &self.ut_unused) .field("ut_session", &self.ut_session) .field("ut_type", &self.ut_type) @@ -641,7 +639,7 @@ cfg_if! { .field("d_type", &self.d_type) // Ignore __unused1 // Ignore __unused2 - // FIXME: .field("d_name", &self.d_name) + // FIXME(debug): .field("d_name", &self.d_name) .finish() } } @@ -703,10 +701,10 @@ cfg_if! { .field("f_flags", &self.f_flags) .field("f_syncwrites", &self.f_syncwrites) .field("f_asyncwrites", &self.f_asyncwrites) - // FIXME: .field("f_mntonname", &self.f_mntonname) + // FIXME(debug): .field("f_mntonname", &self.f_mntonname) .field("f_syncreads", &self.f_syncreads) .field("f_asyncreads", &self.f_asyncreads) - // FIXME: .field("f_mntfromname", &self.f_mntfromname) + // FIXME(debug): .field("f_mntfromname", &self.f_mntfromname) .finish() } } diff --git a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs index 0201008e485fb..ae93648ebd94f 100644 --- a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; pub type clock_t = i32; pub type wchar_t = u32; pub type time_t = i64; diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs index 1624e655a0f4c..e29c9cef3981e 100644 --- a/src/unix/bsd/freebsdlike/freebsd/arm.rs +++ b/src/unix/bsd/freebsdlike/freebsd/arm.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; pub type clock_t = u32; pub type wchar_t = u32; pub type time_t = i64; diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 1e9ab1576625d..2b84898c7068d 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -280,6 +280,22 @@ s! { pub sem_flg: c_short, } + pub struct input_event { + pub time: crate::timeval, + pub type_: crate::u_short, + pub code: crate::u_short, + pub value: i32, + } + + pub struct input_absinfo { + pub value: i32, + pub minimum: i32, + pub maximum: i32, + pub fuzz: i32, + pub flat: i32, + pub resolution: i32, + } + pub struct msqid_ds { pub msg_perm: crate::ipc_perm, __unused1: *mut c_void, @@ -1644,7 +1660,7 @@ s_no_extra_traits! { pub kf_flags: c_int, _kf_pad0: c_int, pub kf_offset: i64, - _priv: [u8; 304], // FIXME: this is really a giant union + _priv: [u8; 304], // FIXME(freebsd): this is really a giant union pub kf_status: u16, _kf_pad1: u16, _kf_ispare0: c_int, @@ -1695,8 +1711,8 @@ cfg_if! { .field("ut_pid", &self.ut_pid) .field("ut_user", &self.ut_user) .field("ut_line", &self.ut_line) - // FIXME: .field("ut_host", &self.ut_host) - // FIXME: .field("__ut_spare", &self.__ut_spare) + // FIXME(debug): .field("ut_host", &self.ut_host) + // FIXME(debug): .field("__ut_spare", &self.__ut_spare) .finish() } } @@ -1783,7 +1799,7 @@ cfg_if! { .field("sdl_nlen", &self.sdl_nlen) .field("sdl_alen", &self.sdl_alen) .field("sdl_slen", &self.sdl_slen) - // FIXME: .field("sdl_data", &self.sdl_data) + // FIXME(debug): .field("sdl_data", &self.sdl_data) .finish() } } @@ -2275,7 +2291,7 @@ cfg_if! { f.debug_struct("sctp_gen_error_cause") .field("code", &{ self.code }) .field("length", &{ self.length }) - // FIXME: .field("info", &{self.info}) + // FIXME(debug): .field("info", &{self.info}) .finish() } } @@ -2347,7 +2363,7 @@ cfg_if! { f.debug_struct("sctp_error_missing_param") .field("cause", &{ self.cause }) .field("num_missing_params", &{ self.num_missing_params }) - // FIXME: .field("tpe", &{self.tpe}) + // FIXME(debug): .field("tpe", &{self.tpe}) .finish() } } @@ -5648,7 +5664,7 @@ extern "C" { pub fn pidfile_close(path: *mut crate::pidfh) -> c_int; pub fn pidfile_remove(path: *mut crate::pidfh) -> c_int; pub fn pidfile_fileno(path: *const crate::pidfh) -> c_int; - // FIXME: pidfile_signal in due time (both manpage present and updated image snapshot) + // FIXME(freebsd): pidfile_signal in due time (both manpage present and updated image snapshot) } #[link(name = "procstat")] diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs index 6c8c973d570d1..9fde25d37b62f 100644 --- a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +++ b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; pub type clock_t = u32; pub type wchar_t = i32; pub type time_t = i64; diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs index a812568b38e7d..e7df7f7737997 100644 --- a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; pub type clock_t = u32; pub type wchar_t = i32; pub type time_t = i64; diff --git a/src/unix/bsd/freebsdlike/freebsd/riscv64.rs b/src/unix/bsd/freebsdlike/freebsd/riscv64.rs index 212413cbe22af..449a29f7d3df4 100644 --- a/src/unix/bsd/freebsdlike/freebsd/riscv64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/riscv64.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; pub type clock_t = i32; pub type wchar_t = c_int; pub type time_t = i64; diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs index bd1267b27cbf4..7dfd670fb55bf 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; pub type clock_t = c_ulong; pub type wchar_t = i32; pub type time_t = i32; diff --git a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs index 199ea643fdab4..065847043225c 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; pub type clock_t = i32; pub type wchar_t = i32; pub type time_t = i64; @@ -346,7 +344,7 @@ cfg_if! { .field("mc_len", &self.mc_len) .field("mc_fpformat", &self.mc_fpformat) .field("mc_ownedfp", &self.mc_ownedfp) - // FIXME: .field("mc_fpstate", &self.mc_fpstate) + // FIXME(debug): .field("mc_fpstate", &self.mc_fpstate) .field("mc_fsbase", &self.mc_fsbase) .field("mc_gsbase", &self.mc_gsbase) .field("mc_xfpustate", &self.mc_xfpustate) diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 2ea8d2ac72f9a..e172db7e4e1a3 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -418,7 +418,7 @@ cfg_if! { .field("ss_family", &self.ss_family) .field("__ss_pad1", &self.__ss_pad1) .field("__ss_align", &self.__ss_align) - // FIXME: .field("__ss_pad2", &self.__ss_pad2) + // FIXME(debug): .field("__ss_pad2", &self.__ss_pad2) .finish() } } diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 85a746422e554..047e2afd30bc5 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -639,7 +639,7 @@ safe_f! { } pub {const} fn WEXITSTATUS(status: c_int) -> c_int { - status >> 8 + (status >> 8) & 0x00ff } pub {const} fn WCOREDUMP(status: c_int) -> bool { diff --git a/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/src/unix/bsd/netbsdlike/netbsd/aarch64.rs index dbac03d2fb2ac..b511fc8457752 100644 --- a/src/unix/bsd/netbsdlike/netbsd/aarch64.rs +++ b/src/unix/bsd/netbsdlike/netbsd/aarch64.rs @@ -1,8 +1,6 @@ use crate::prelude::*; use crate::PT_FIRSTMACH; -pub type c_long = i64; -pub type c_ulong = u64; pub type greg_t = u64; pub type __cpu_simple_lock_nv_t = c_uchar; diff --git a/src/unix/bsd/netbsdlike/netbsd/arm.rs b/src/unix/bsd/netbsdlike/netbsd/arm.rs index 698eba93b31a5..b252862dfe650 100644 --- a/src/unix/bsd/netbsdlike/netbsd/arm.rs +++ b/src/unix/bsd/netbsdlike/netbsd/arm.rs @@ -1,8 +1,6 @@ use crate::prelude::*; use crate::PT_FIRSTMACH; -pub type c_long = i32; -pub type c_ulong = u32; pub type __cpu_simple_lock_nv_t = c_int; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/netbsd/mips.rs b/src/unix/bsd/netbsdlike/netbsd/mips.rs index 028deb0cfbf76..eabfe1bbcc1e8 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mips.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mips.rs @@ -1,8 +1,6 @@ use crate::prelude::*; use crate::PT_FIRSTMACH; -pub type c_long = i32; -pub type c_ulong = u32; pub type __cpu_simple_lock_nv_t = c_int; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 1840015e1d14b..72eb0e6e69aef 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -10,7 +10,7 @@ pub type fsfilcnt_t = u64; pub type idtype_t = c_int; pub type mqd_t = c_int; type __pthread_spin_t = __cpu_simple_lock_nv_t; -pub type vm_size_t = crate::uintptr_t; // FIXME: deprecated since long time +pub type vm_size_t = crate::uintptr_t; // FIXME(deprecated): deprecated since long time pub type lwpid_t = c_uint; pub type shmatt_t = c_uint; pub type cpuid_t = c_ulong; @@ -297,7 +297,8 @@ s! { pub flags: u32, pub fflags: u32, pub data: i64, - pub udata: intptr_t, /* FIXME: NetBSD 10.0 will finally have same layout as other BSD */ + // FIXME(netbsd): NetBSD 10.0 will finally have same layout as other BSD + pub udata: intptr_t, } pub struct dqblk { @@ -799,7 +800,7 @@ s_no_extra_traits! { pub ut_session: u16, pub ut_type: u16, pub ut_pid: crate::pid_t, - pub ut_exit: __exit_status, // FIXME: when anonymous struct are supported + pub ut_exit: __exit_status, // FIXME(netbsd): when anonymous struct are supported pub ut_ss: sockaddr_storage, pub ut_tv: crate::timeval, pub ut_pad: [u8; _UTX_PADSIZE], @@ -945,14 +946,14 @@ cfg_if! { .field("ut_name", &self.ut_name) .field("ut_id", &self.ut_id) .field("ut_line", &self.ut_line) - // FIXME .field("ut_host", &self.ut_host) + // FIXME(debug) .field("ut_host", &self.ut_host) .field("ut_session", &self.ut_session) .field("ut_type", &self.ut_type) .field("ut_pid", &self.ut_pid) .field("ut_exit", &self.ut_exit) .field("ut_ss", &self.ut_ss) .field("ut_tv", &self.ut_tv) - // FIXME .field("ut_pad", &self.ut_pad) + // FIXME(debug) .field("ut_pad", &self.ut_pad) .finish() } } @@ -993,7 +994,7 @@ cfg_if! { f.debug_struct("lastlogx") .field("ll_tv", &self.ll_tv) .field("ll_line", &self.ll_line) - // FIXME.field("ll_host", &self.ll_host) + // FIXME(debug).field("ll_host", &self.ll_host) .field("ll_ss", &self.ll_ss) .finish() } @@ -1159,7 +1160,7 @@ cfg_if! { .field("d_reclen", &self.d_reclen) .field("d_namlen", &self.d_namlen) .field("d_type", &self.d_type) - // FIXME: .field("d_name", &self.d_name) + // FIXME(debug): .field("d_name", &self.d_name) .finish() } } @@ -1235,8 +1236,8 @@ cfg_if! { .field("f_owner", &self.f_owner) .field("f_spare", &self.f_spare) .field("f_fstypename", &self.f_fstypename) - // FIXME: .field("f_mntonname", &self.f_mntonname) - // FIXME: .field("f_mntfromname", &self.f_mntfromname) + // FIXME(debug): .field("f_mntonname", &self.f_mntonname) + // FIXME(debug): .field("f_mntfromname", &self.f_mntfromname) .finish() } } @@ -1290,7 +1291,7 @@ cfg_if! { .field("ss_family", &self.ss_family) .field("__ss_pad1", &self.__ss_pad1) .field("__ss_pad2", &self.__ss_pad2) - // FIXME: .field("__ss_pad3", &self.__ss_pad3) + // FIXME(debug): .field("__ss_pad3", &self.__ss_pad3) .finish() } } @@ -2849,7 +2850,7 @@ extern "C" { ntargets: size_t, hint: *const c_void, ) -> c_int; - + #[link_name = "__getmntinfo13"] pub fn getmntinfo(mntbufp: *mut *mut crate::statvfs, flags: c_int) -> c_int; pub fn getvfsstat(buf: *mut statvfs, bufsize: size_t, flags: c_int) -> c_int; } diff --git a/src/unix/bsd/netbsdlike/netbsd/powerpc.rs b/src/unix/bsd/netbsdlike/netbsd/powerpc.rs index 20eba6849a3ee..fc4cc3898e12a 100644 --- a/src/unix/bsd/netbsdlike/netbsd/powerpc.rs +++ b/src/unix/bsd/netbsdlike/netbsd/powerpc.rs @@ -1,8 +1,6 @@ use crate::prelude::*; use crate::PT_FIRSTMACH; -pub type c_long = i32; -pub type c_ulong = u32; pub type __cpu_simple_lock_nv_t = c_int; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/netbsd/riscv64.rs b/src/unix/bsd/netbsdlike/netbsd/riscv64.rs index 0437b994ca276..550c3bd7bb4ea 100644 --- a/src/unix/bsd/netbsdlike/netbsd/riscv64.rs +++ b/src/unix/bsd/netbsdlike/netbsd/riscv64.rs @@ -2,8 +2,6 @@ use PT_FIRSTMACH; use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; pub type __greg_t = u64; pub type __cpu_simple_lock_nv_t = c_int; pub type __gregset = [__greg_t; _NGREG]; diff --git a/src/unix/bsd/netbsdlike/netbsd/sparc64.rs b/src/unix/bsd/netbsdlike/netbsd/sparc64.rs index 3cfe535e7edfa..91622f7eea3fa 100644 --- a/src/unix/bsd/netbsdlike/netbsd/sparc64.rs +++ b/src/unix/bsd/netbsdlike/netbsd/sparc64.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; pub type __cpu_simple_lock_nv_t = c_uchar; // should be pub(crate), but that requires Rust 1.18.0 diff --git a/src/unix/bsd/netbsdlike/netbsd/x86.rs b/src/unix/bsd/netbsdlike/netbsd/x86.rs index 04741f2dc1f4e..92e160d9bca0c 100644 --- a/src/unix/bsd/netbsdlike/netbsd/x86.rs +++ b/src/unix/bsd/netbsdlike/netbsd/x86.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; pub type __cpu_simple_lock_nv_t = c_uchar; pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; diff --git a/src/unix/bsd/netbsdlike/netbsd/x86_64.rs b/src/unix/bsd/netbsdlike/netbsd/x86_64.rs index 52f3da771a157..5d31c0661e9c6 100644 --- a/src/unix/bsd/netbsdlike/netbsd/x86_64.rs +++ b/src/unix/bsd/netbsdlike/netbsd/x86_64.rs @@ -1,8 +1,6 @@ use crate::prelude::*; use crate::PT_FIRSTMACH; -pub type c_long = i64; -pub type c_ulong = u64; pub type c___greg_t = u64; pub type __cpu_simple_lock_nv_t = c_uchar; diff --git a/src/unix/bsd/netbsdlike/openbsd/aarch64.rs b/src/unix/bsd/netbsdlike/openbsd/aarch64.rs index 4cd0b32549835..2c4b1df26ce83 100644 --- a/src/unix/bsd/netbsdlike/openbsd/aarch64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/aarch64.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; pub type ucontext_t = sigcontext; s! { diff --git a/src/unix/bsd/netbsdlike/openbsd/arm.rs b/src/unix/bsd/netbsdlike/openbsd/arm.rs index 7fd17cf65a55f..ae91cde0a1739 100644 --- a/src/unix/bsd/netbsdlike/openbsd/arm.rs +++ b/src/unix/bsd/netbsdlike/openbsd/arm.rs @@ -1,8 +1,5 @@ use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; - pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; pub const _MAX_PAGE_SHIFT: u32 = 12; diff --git a/src/unix/bsd/netbsdlike/openbsd/mips64.rs b/src/unix/bsd/netbsdlike/openbsd/mips64.rs index 17ebae2889f17..162ceda265df9 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mips64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mips64.rs @@ -1,6 +1,3 @@ -pub type c_long = i64; -pub type c_ulong = u64; - #[doc(hidden)] pub const _ALIGNBYTES: usize = 7; diff --git a/src/unix/bsd/netbsdlike/openbsd/powerpc.rs b/src/unix/bsd/netbsdlike/openbsd/powerpc.rs index 7fd17cf65a55f..ae91cde0a1739 100644 --- a/src/unix/bsd/netbsdlike/openbsd/powerpc.rs +++ b/src/unix/bsd/netbsdlike/openbsd/powerpc.rs @@ -1,8 +1,5 @@ use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; - pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; pub const _MAX_PAGE_SHIFT: u32 = 12; diff --git a/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs b/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs index 1a3b452091ce0..1c3d8df3b7956 100644 --- a/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs @@ -1,8 +1,5 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; - pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; pub const _MAX_PAGE_SHIFT: u32 = 12; diff --git a/src/unix/bsd/netbsdlike/openbsd/riscv64.rs b/src/unix/bsd/netbsdlike/openbsd/riscv64.rs index d37e9a67e6888..a0865406b80f3 100644 --- a/src/unix/bsd/netbsdlike/openbsd/riscv64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/riscv64.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; pub type ucontext_t = sigcontext; s! { diff --git a/src/unix/bsd/netbsdlike/openbsd/sparc64.rs b/src/unix/bsd/netbsdlike/openbsd/sparc64.rs index f8e165a7de299..88481f4f014e8 100644 --- a/src/unix/bsd/netbsdlike/openbsd/sparc64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/sparc64.rs @@ -1,6 +1,3 @@ -pub type c_long = i64; -pub type c_ulong = u64; - #[doc(hidden)] pub const _ALIGNBYTES: usize = 0xf; diff --git a/src/unix/bsd/netbsdlike/openbsd/x86.rs b/src/unix/bsd/netbsdlike/openbsd/x86.rs index cac4ea7f8e94c..d2cf7832edd7f 100644 --- a/src/unix/bsd/netbsdlike/openbsd/x86.rs +++ b/src/unix/bsd/netbsdlike/openbsd/x86.rs @@ -1,8 +1,5 @@ use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; - pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; pub const _MAX_PAGE_SHIFT: u32 = 12; diff --git a/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/src/unix/bsd/netbsdlike/openbsd/x86_64.rs index 683046836320d..db9114e27cb60 100644 --- a/src/unix/bsd/netbsdlike/openbsd/x86_64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/x86_64.rs @@ -1,8 +1,6 @@ use crate::prelude::*; use crate::PT_FIRSTMACH; -pub type c_long = i64; -pub type c_ulong = u64; pub type ucontext_t = sigcontext; s! { diff --git a/src/unix/haiku/b32.rs b/src/unix/haiku/b32.rs index c1135c834ef8b..1aa27e615ca4e 100644 --- a/src/unix/haiku/b32.rs +++ b/src/unix/haiku/b32.rs @@ -1,5 +1,3 @@ -pub type c_long = i32; -pub type c_ulong = u32; pub type time_t = i32; pub type Elf_Addr = crate::Elf32_Addr; diff --git a/src/unix/haiku/b64.rs b/src/unix/haiku/b64.rs index 96617042cf2ab..3355241fdb797 100644 --- a/src/unix/haiku/b64.rs +++ b/src/unix/haiku/b64.rs @@ -1,5 +1,3 @@ -pub type c_ulong = u64; -pub type c_long = i64; pub type time_t = i64; pub type Elf_Addr = crate::Elf64_Addr; diff --git a/src/unix/hurd/b32.rs b/src/unix/hurd/b32.rs index 5223d549dd025..e706789006dba 100644 --- a/src/unix/hurd/b32.rs +++ b/src/unix/hurd/b32.rs @@ -1,8 +1,5 @@ use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; - pub type __int64_t = c_longlong; pub type __uint64_t = c_ulonglong; diff --git a/src/unix/hurd/b64.rs b/src/unix/hurd/b64.rs index 1954c27f88563..a44428c575adf 100644 --- a/src/unix/hurd/b64.rs +++ b/src/unix/hurd/b64.rs @@ -1,8 +1,5 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; - pub type __int64_t = c_long; pub type __uint64_t = c_ulong; diff --git a/src/unix/linux_like/android/b32/mod.rs b/src/unix/linux_like/android/b32/mod.rs index 3e3485757ce98..42be94d425c72 100644 --- a/src/unix/linux_like/android/b32/mod.rs +++ b/src/unix/linux_like/android/b32/mod.rs @@ -3,8 +3,6 @@ use crate::prelude::*; // The following definitions are correct for arm and i686, // but may be wrong for mips -pub type c_long = i32; -pub type c_ulong = u32; pub type mode_t = u16; pub type off64_t = c_longlong; pub type sigset_t = c_ulong; diff --git a/src/unix/linux_like/android/b64/mod.rs b/src/unix/linux_like/android/b64/mod.rs index 0da702b45d18e..cc407e113f67a 100644 --- a/src/unix/linux_like/android/b64/mod.rs +++ b/src/unix/linux_like/android/b64/mod.rs @@ -3,8 +3,6 @@ use crate::prelude::*; // The following definitions are correct for aarch64 and x86_64, // but may be wrong for mips64 -pub type c_long = i64; -pub type c_ulong = u64; pub type mode_t = u32; pub type off64_t = i64; pub type socklen_t = u32; diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 49178d62b2a5d..11ff0fd57d0fe 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -1432,6 +1432,7 @@ pub const SOCK_STREAM: c_int = 1; pub const SOCK_DGRAM: c_int = 2; pub const SOCK_SEQPACKET: c_int = 5; pub const SOCK_DCCP: c_int = 6; +#[deprecated(since = "0.2.70", note = "AF_PACKET must be used instead")] pub const SOCK_PACKET: c_int = 10; pub const IPPROTO_MAX: c_int = 256; @@ -2900,6 +2901,9 @@ pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11; pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12; pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13; pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14; +pub const SOF_TIMESTAMPING_BIND_PHC: c_uint = 1 << 15; +pub const SOF_TIMESTAMPING_OPT_ID_TCP: c_uint = 1 << 16; +pub const SOF_TIMESTAMPING_OPT_RX_FILTER: c_uint = 1 << 17; #[deprecated( since = "0.2.55", diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index 07e20342fca22..9c37effbe92e0 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -27,8 +27,6 @@ pub type blksize_t = c_long; pub type fsblkcnt_t = u32; pub type fsfilcnt_t = u32; pub type rlim_t = u64; -pub type c_long = i32; -pub type c_ulong = u32; pub type nlink_t = u32; pub type ino64_t = crate::ino_t; @@ -227,16 +225,16 @@ s! { } pub struct stat { pub st_dev: crate::dev_t, - #[cfg(not(emscripten_new_stat_abi))] + #[cfg(emscripten_old_stat_abi)] __st_dev_padding: c_int, - #[cfg(not(emscripten_new_stat_abi))] + #[cfg(emscripten_old_stat_abi)] __st_ino_truncated: c_long, 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, - #[cfg(not(emscripten_new_stat_abi))] + #[cfg(emscripten_old_stat_abi)] __st_rdev_padding: c_int, pub st_size: off_t, pub st_blksize: crate::blksize_t, diff --git a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs index b15df99e50ec6..249ed09a0dadd 100644 --- a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs @@ -4,6 +4,30 @@ use crate::{off64_t, off_t}; pub type wchar_t = i32; s! { + pub struct stat { + pub st_dev: c_ulong, + + st_pad1: [c_long; 3], + 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_ulong, + st_pad2: [c_long; 2], + pub st_size: off_t, + st_pad3: c_long, + 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, + pub st_blocks: crate::blkcnt_t, + st_pad5: [c_long; 14], + } + pub struct stat64 { pub st_dev: c_ulong, st_pad1: [c_long; 3], diff --git a/src/unix/linux_like/linux/gnu/b32/mod.rs b/src/unix/linux_like/linux/gnu/b32/mod.rs index adb36cc169fef..134bfb05b7470 100644 --- a/src/unix/linux_like/linux/gnu/b32/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/mod.rs @@ -3,8 +3,6 @@ use crate::prelude::*; use crate::pthread_mutex_t; -pub type c_long = i32; -pub type c_ulong = u32; pub type clock_t = i32; pub type shmatt_t = c_ulong; @@ -42,55 +40,37 @@ cfg_if! { } } -s! { - pub struct stat { - #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] - pub st_dev: crate::dev_t, - #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] - pub st_dev: c_ulong, - - #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] - __pad1: c_short, - #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] - st_pad1: [c_long; 3], - 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, - #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] - pub st_rdev: crate::dev_t, - #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] - pub st_rdev: c_ulong, - #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] - __pad2: c_short, - #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] - st_pad2: [c_long; 2], - pub st_size: off_t, - #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] - st_pad3: c_long, - #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] - pub st_blksize: crate::blksize_t, - #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] - 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, - #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] - __unused4: c_long, - #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] - __unused5: c_long, - #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] - pub st_blksize: crate::blksize_t, - #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] - pub st_blocks: crate::blkcnt_t, - #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] - st_pad5: [c_long; 14], +cfg_if! { + if #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] { + s! { + pub struct stat { + pub st_dev: crate::dev_t, + + __pad1: c_short, + 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, + __pad2: c_short, + 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: c_long, + __unused5: c_long, + } + } } +} +s! { pub struct statvfs { pub f_bsize: c_ulong, pub f_frsize: c_ulong, diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs index cec3b7ee28b5a..f808ff31f8cca 100644 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs +++ b/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs @@ -1,8 +1,6 @@ +use crate::prelude::*; use crate::pthread_mutex_t; -pub type c_long = i32; -pub type c_ulong = u32; - pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs index 4b09e476d370c..960e5127806b3 100644 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs +++ b/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs @@ -1,8 +1,6 @@ +use crate::prelude::*; use crate::pthread_mutex_t; -pub type c_long = i64; -pub type c_ulong = u64; - pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8; diff --git a/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs index e8f045ba5f83b..6162565da17ca 100644 --- a/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs @@ -1,8 +1,6 @@ use crate::prelude::*; use crate::{off64_t, off_t, pthread_mutex_t}; -pub type c_long = i64; -pub type c_ulong = u64; pub type wchar_t = i32; pub type blksize_t = i32; diff --git a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs index 1d13bdb945d6e..375ea40cb6a1d 100644 --- a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs @@ -2,8 +2,6 @@ use crate::prelude::*; use crate::{off64_t, off_t, pthread_mutex_t}; pub type blksize_t = i64; -pub type c_long = i64; -pub type c_ulong = u64; pub type nlink_t = u64; pub type suseconds_t = i64; pub type wchar_t = i32; diff --git a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs index 3eda86440d40c..e537dbcd0a86a 100644 --- a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs @@ -3,8 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t, pthread_mutex_t}; -pub type c_long = i64; -pub type c_ulong = u64; pub type wchar_t = i32; pub type nlink_t = u64; pub type blksize_t = i64; diff --git a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs index 3dd9369457353..578057ce58ed2 100644 --- a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs @@ -3,8 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t}; -pub type c_long = i64; -pub type c_ulong = u64; pub type wchar_t = c_int; pub type nlink_t = c_uint; diff --git a/src/unix/linux_like/linux/gnu/b64/s390x.rs b/src/unix/linux_like/linux/gnu/b64/s390x.rs index 7a48de58c967b..c08e12108b918 100644 --- a/src/unix/linux_like/linux/gnu/b64/s390x.rs +++ b/src/unix/linux_like/linux/gnu/b64/s390x.rs @@ -4,8 +4,6 @@ use crate::prelude::*; use crate::{off64_t, off_t, pthread_mutex_t}; pub type blksize_t = i64; -pub type c_long = i64; -pub type c_ulong = u64; pub type nlink_t = u64; pub type suseconds_t = i64; pub type wchar_t = i32; diff --git a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs index 829686ff16ee5..f77606e10cbf5 100644 --- a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs @@ -3,8 +3,6 @@ use crate::prelude::*; use crate::{off64_t, off_t, pthread_mutex_t}; -pub type c_long = i64; -pub type c_ulong = u64; pub type wchar_t = i32; pub type nlink_t = u32; pub type blksize_t = i64; diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs index eb9563e53e2c0..27b96a60aabd8 100644 --- a/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs +++ b/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs @@ -1,9 +1,6 @@ use crate::prelude::*; use crate::pthread_mutex_t; -pub type c_long = i64; -pub type c_ulong = u64; - s! { pub struct statvfs { pub f_bsize: c_ulong, diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs index eafb5246c9edc..1a1cd34be035f 100644 --- a/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs +++ b/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs @@ -1,9 +1,6 @@ use crate::prelude::*; use crate::pthread_mutex_t; -pub type c_long = i32; -pub type c_ulong = u32; - s! { pub struct statvfs { pub f_bsize: c_ulong, diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index fb1233e5774a6..f0a051457ac05 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -767,6 +767,7 @@ pub const ENOTSUP: c_int = EOPNOTSUPP; pub const SOCK_SEQPACKET: c_int = 5; pub const SOCK_DCCP: c_int = 6; +#[deprecated(since = "0.2.70", note = "AF_PACKET must be used instead")] pub const SOCK_PACKET: c_int = 10; pub const AF_IB: c_int = 27; diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 37b1e673b2e20..cdf9032c7cbc1 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -185,6 +185,7 @@ s! { pub mr_address: [c_uchar; 8], } + #[deprecated(since = "0.2.70", note = "sockaddr_ll type must be used instead")] pub struct sockaddr_pkt { pub spkt_family: c_ushort, pub spkt_device: [c_uchar; 14], @@ -4581,6 +4582,9 @@ pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11; pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12; pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13; pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14; +pub const SOF_TIMESTAMPING_BIND_PHC: c_uint = 1 << 15; +pub const SOF_TIMESTAMPING_OPT_ID_TCP: c_uint = 1 << 16; +pub const SOF_TIMESTAMPING_OPT_RX_FILTER: c_uint = 1 << 17; pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0; pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1; diff --git a/src/unix/linux_like/linux/musl/b32/mod.rs b/src/unix/linux_like/linux/musl/b32/mod.rs index 4a62ef1906ffb..00b3d7705090f 100644 --- a/src/unix/linux_like/linux/musl/b32/mod.rs +++ b/src/unix/linux_like/linux/musl/b32/mod.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; pub type nlink_t = u32; pub type blksize_t = c_long; pub type __u64 = c_ulonglong; diff --git a/src/unix/linux_like/linux/musl/b64/mod.rs b/src/unix/linux_like/linux/musl/b64/mod.rs index 50d862f570426..b6e7de6591809 100644 --- a/src/unix/linux_like/linux/musl/b64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/mod.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; pub type regoff_t = c_long; s! { diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 70e4b5900d6f4..9793a236b9be5 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -718,6 +718,7 @@ pub const MAP_ANONYMOUS: c_int = MAP_ANON; pub const SOCK_SEQPACKET: c_int = 5; pub const SOCK_DCCP: c_int = 6; pub const SOCK_NONBLOCK: c_int = O_NONBLOCK; +#[deprecated(since = "0.2.70", note = "AF_PACKET must be used instead")] pub const SOCK_PACKET: c_int = 10; pub const SOMAXCONN: c_int = 128; diff --git a/src/unix/linux_like/linux/uclibc/arm/mod.rs b/src/unix/linux_like/linux/uclibc/arm/mod.rs index c237b7e160bbf..000d9e33a734a 100644 --- a/src/unix/linux_like/linux/uclibc/arm/mod.rs +++ b/src/unix/linux_like/linux/uclibc/arm/mod.rs @@ -2,8 +2,6 @@ use crate::off64_t; use crate::prelude::*; pub type wchar_t = c_uint; -pub type c_long = i32; -pub type c_ulong = u32; pub type time_t = c_long; pub type clock_t = c_long; diff --git a/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs b/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs index a78daea80b62c..783b879cbf8dd 100644 --- a/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs @@ -1,8 +1,6 @@ use crate::off64_t; use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; pub type clock_t = i32; pub type time_t = i32; pub type suseconds_t = i32; diff --git a/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs b/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs index d0a0f345546b6..2e60f0d03fff9 100644 --- a/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs @@ -3,8 +3,6 @@ use crate::prelude::*; pub type blkcnt_t = i64; pub type blksize_t = i64; -pub type c_long = i64; -pub type c_ulong = u64; pub type fsblkcnt_t = c_ulong; pub type fsfilcnt_t = c_ulong; pub type ino_t = u64; diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs index 7495f07878119..272f3c4e223b2 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -382,6 +382,7 @@ pub const RUSAGE_THREAD: c_int = 1; pub const SHM_EXEC: c_int = 0o100000; pub const SIGPOLL: c_int = SIGIO; pub const SOCK_DCCP: c_int = 6; +#[deprecated(since = "0.2.70", note = "AF_PACKET must be used instead")] pub const SOCK_PACKET: c_int = 10; pub const TCP_COOKIE_TRANSACTIONS: c_int = 15; pub const UDP_GRO: c_int = 104; diff --git a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs index 7ede4d020d6f3..aef9f420f4659 100644 --- a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs +++ b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs @@ -6,8 +6,6 @@ use crate::prelude::*; pub type blkcnt_t = i64; pub type blksize_t = i64; pub type clock_t = i64; -pub type c_long = i64; -pub type c_ulong = u64; pub type fsblkcnt_t = c_ulong; pub type fsfilcnt_t = c_ulong; pub type fsword_t = c_long; diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 84298804c594f..d303325c57008 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -5,16 +5,6 @@ use crate::prelude::*; -pub type c_schar = i8; -pub type c_uchar = u8; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_int = i32; -pub type c_uint = u32; -pub type c_float = f32; -pub type c_double = f64; -pub type c_longlong = i64; -pub type c_ulonglong = u64; pub type intmax_t = i64; pub type uintmax_t = u64; diff --git a/src/unix/newlib/aarch64/mod.rs b/src/unix/newlib/aarch64/mod.rs index f0ab09443da22..e4640580e2478 100644 --- a/src/unix/newlib/aarch64/mod.rs +++ b/src/unix/newlib/aarch64/mod.rs @@ -3,9 +3,6 @@ use crate::prelude::*; pub type clock_t = c_long; pub type wchar_t = u32; -pub type c_long = i64; -pub type c_ulong = u64; - s! { pub struct sockaddr { pub sa_len: u8, diff --git a/src/unix/newlib/arm/mod.rs b/src/unix/newlib/arm/mod.rs index ae89440f237db..aea4ed764b03c 100644 --- a/src/unix/newlib/arm/mod.rs +++ b/src/unix/newlib/arm/mod.rs @@ -3,9 +3,6 @@ use crate::prelude::*; pub type clock_t = c_long; pub type wchar_t = u32; -pub type c_long = i32; -pub type c_ulong = u32; - s! { pub struct sockaddr { pub sa_family: crate::sa_family_t, diff --git a/src/unix/newlib/espidf/mod.rs b/src/unix/newlib/espidf/mod.rs index 0bb8e3ae9c766..57a033fcaf263 100644 --- a/src/unix/newlib/espidf/mod.rs +++ b/src/unix/newlib/espidf/mod.rs @@ -3,9 +3,6 @@ use crate::prelude::*; pub type clock_t = c_ulong; pub type wchar_t = u32; -pub type c_long = i32; -pub type c_ulong = u32; - s! { pub struct cmsghdr { pub cmsg_len: crate::socklen_t, diff --git a/src/unix/newlib/horizon/mod.rs b/src/unix/newlib/horizon/mod.rs index 05a1b284e295d..e98a4c53ccfff 100644 --- a/src/unix/newlib/horizon/mod.rs +++ b/src/unix/newlib/horizon/mod.rs @@ -3,9 +3,6 @@ use crate::off_t; use crate::prelude::*; -pub type c_long = i32; -pub type c_ulong = u32; - pub type wchar_t = c_uint; pub type u_register_t = c_uint; diff --git a/src/unix/newlib/powerpc/mod.rs b/src/unix/newlib/powerpc/mod.rs index b53c832a71aed..c4d4a2ed07c5e 100644 --- a/src/unix/newlib/powerpc/mod.rs +++ b/src/unix/newlib/powerpc/mod.rs @@ -3,9 +3,6 @@ use crate::prelude::*; pub type clock_t = c_ulong; pub type wchar_t = c_int; -pub type c_long = i32; -pub type c_ulong = u32; - pub use crate::unix::newlib::generic::{dirent, sigset_t, stat}; // the newlib shipped with devkitPPC does not support the following components: diff --git a/src/unix/newlib/vita/mod.rs b/src/unix/newlib/vita/mod.rs index 1f531cb4d35ff..822b61989d479 100644 --- a/src/unix/newlib/vita/mod.rs +++ b/src/unix/newlib/vita/mod.rs @@ -5,9 +5,6 @@ pub type clock_t = c_long; pub type wchar_t = u32; -pub type c_long = i32; -pub type c_ulong = u32; - pub type sigset_t = c_ulong; s! { diff --git a/src/unix/nto/aarch64.rs b/src/unix/nto/aarch64.rs index acc36bbf75363..559ab6e49a45d 100644 --- a/src/unix/nto/aarch64.rs +++ b/src/unix/nto/aarch64.rs @@ -1,8 +1,6 @@ use crate::prelude::*; pub type wchar_t = u32; -pub type c_long = i64; -pub type c_ulong = u64; pub type time_t = i64; s! { diff --git a/src/unix/nto/x86_64.rs b/src/unix/nto/x86_64.rs index 6cd24e187c443..521b5d4ab7879 100644 --- a/src/unix/nto/x86_64.rs +++ b/src/unix/nto/x86_64.rs @@ -1,8 +1,6 @@ use crate::prelude::*; pub type wchar_t = u32; -pub type c_long = i64; -pub type c_ulong = u64; pub type time_t = i64; s! { diff --git a/src/unix/nuttx/mod.rs b/src/unix/nuttx/mod.rs index 0f19cc75e6350..8446eafaf19e6 100644 --- a/src/unix/nuttx/mod.rs +++ b/src/unix/nuttx/mod.rs @@ -5,8 +5,6 @@ pub type nlink_t = u16; pub type ino_t = u16; pub type blkcnt_t = u64; pub type blksize_t = i16; -pub type c_long = isize; -pub type c_ulong = usize; pub type cc_t = u8; pub type clock_t = i64; pub type dev_t = i32; diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 059264c01ffcb..42d97b42c14f3 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -2,20 +2,6 @@ use crate::prelude::*; pub type wchar_t = i32; -cfg_if! { - if #[cfg(target_pointer_width = "32")] { - pub type c_long = i32; - pub type c_ulong = u32; - } -} - -cfg_if! { - if #[cfg(target_pointer_width = "64")] { - pub type c_long = i64; - pub type c_ulong = u64; - } -} - pub type blkcnt_t = c_ulong; pub type blksize_t = c_long; pub type clock_t = c_long; diff --git a/src/unix/solarish/illumos.rs b/src/unix/solarish/illumos.rs index a1adae00dcc12..caa3f27b3cb35 100644 --- a/src/unix/solarish/illumos.rs +++ b/src/unix/solarish/illumos.rs @@ -205,6 +205,8 @@ pub const POSIX_FADV_WILLNEED: c_int = 3; pub const POSIX_FADV_DONTNEED: c_int = 4; pub const POSIX_FADV_NOREUSE: c_int = 5; +pub const POSIX_SPAWN_SETSID: c_short = 0x40; + pub const SIGINFO: c_int = 41; pub const O_DIRECT: c_int = 0x2000000; @@ -335,6 +337,11 @@ extern "C" { pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; pub fn getpagesizes2(pagesize: *mut size_t, nelem: c_int) -> c_int; + pub fn posix_spawn_file_actions_addfchdir_np( + file_actions: *mut crate::posix_spawn_file_actions_t, + fd: c_int, + ) -> c_int; + pub fn ptsname_r(fildes: c_int, name: *mut c_char, namelen: size_t) -> c_int; pub fn syncfs(fd: c_int) -> c_int; diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 228ba04b84455..c73eecd838426 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -2,8 +2,6 @@ use core::mem::size_of; use crate::prelude::*; -pub type c_long = i64; -pub type c_ulong = u64; pub type caddr_t = *mut c_char; pub type clockid_t = c_int; @@ -56,6 +54,9 @@ pub type lgrp_lat_between_t = c_uint; pub type lgrp_mem_size_flag_t = c_uint; pub type lgrp_view_t = c_uint; +pub type posix_spawnattr_t = *mut c_void; +pub type posix_spawn_file_actions_t = *mut c_void; + #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} impl Copy for timezone {} @@ -1543,6 +1544,17 @@ pub const POSIX_MADV_SEQUENTIAL: c_int = 2; pub const POSIX_MADV_WILLNEED: c_int = 3; pub const POSIX_MADV_DONTNEED: c_int = 4; +pub const POSIX_SPAWN_RESETIDS: c_short = 0x1; +pub const POSIX_SPAWN_SETPGROUP: c_short = 0x2; +pub const POSIX_SPAWN_SETSIGDEF: c_short = 0x4; +pub const POSIX_SPAWN_SETSIGMASK: c_short = 0x8; +pub const POSIX_SPAWN_SETSCHEDPARAM: c_short = 0x10; +pub const POSIX_SPAWN_SETSCHEDULER: c_short = 0x20; +pub const POSIX_SPAWN_SETSIGIGN_NP: c_short = 0x800; +pub const POSIX_SPAWN_NOSIGCHLD_NP: c_short = 0x1000; +pub const POSIX_SPAWN_WAITPID_NP: c_short = 0x2000; +pub const POSIX_SPAWN_NOEXECERR_NP: c_short = 0x4000; + pub const PTHREAD_CREATE_JOINABLE: c_int = 0; pub const PTHREAD_CREATE_DETACHED: c_int = 0x40; pub const PTHREAD_PROCESS_SHARED: c_int = 1; @@ -2688,6 +2700,106 @@ extern "C" { pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; + pub fn posix_spawn( + pid: *mut crate::pid_t, + path: *const c_char, + file_actions: *const posix_spawn_file_actions_t, + attrp: *const posix_spawnattr_t, + argv: *const *mut c_char, + envp: *const *mut c_char, + ) -> c_int; + pub fn posix_spawnp( + pid: *mut crate::pid_t, + file: *const c_char, + file_actions: *const posix_spawn_file_actions_t, + attrp: *const posix_spawnattr_t, + argv: *const *mut c_char, + envp: *const *mut c_char, + ) -> c_int; + + pub fn posix_spawn_file_actions_init(file_actions: *mut posix_spawn_file_actions_t) -> c_int; + pub fn posix_spawn_file_actions_destroy(file_actions: *mut posix_spawn_file_actions_t) + -> c_int; + pub fn posix_spawn_file_actions_addopen( + file_actions: *mut posix_spawn_file_actions_t, + fildes: c_int, + path: *const c_char, + oflag: c_int, + mode: crate::mode_t, + ) -> c_int; + pub fn posix_spawn_file_actions_addclose( + file_actions: *mut posix_spawn_file_actions_t, + fildes: c_int, + ) -> c_int; + pub fn posix_spawn_file_actions_adddup2( + file_actions: *mut posix_spawn_file_actions_t, + fildes: c_int, + newfildes: c_int, + ) -> c_int; + pub fn posix_spawn_file_actions_addclosefrom_np( + file_actions: *mut posix_spawn_file_actions_t, + lowfiledes: c_int, + ) -> c_int; + pub fn posix_spawn_file_actions_addchdir( + file_actions: *mut posix_spawn_file_actions_t, + path: *const c_char, + ) -> c_int; + pub fn posix_spawn_file_actions_addchdir_np( + file_actions: *mut posix_spawn_file_actions_t, + path: *const c_char, + ) -> c_int; + pub fn posix_spawn_file_actions_addfchdir( + file_actions: *mut posix_spawn_file_actions_t, + fd: c_int, + ) -> c_int; + + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int; + pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int; + pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int; + pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, pgroup: crate::pid_t) -> c_int; + pub fn posix_spawnattr_getpgroup( + attr: *const posix_spawnattr_t, + _pgroup: *mut crate::pid_t, + ) -> c_int; + pub fn posix_spawnattr_setschedparam( + attr: *mut posix_spawnattr_t, + param: *const crate::sched_param, + ) -> c_int; + pub fn posix_spawnattr_getschedparam( + attr: *const posix_spawnattr_t, + param: *mut crate::sched_param, + ) -> c_int; + pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, policy: c_int) -> c_int; + pub fn posix_spawnattr_getschedpolicy( + attr: *const posix_spawnattr_t, + _policy: *mut c_int, + ) -> c_int; + pub fn posix_spawnattr_setsigdefault( + attr: *mut posix_spawnattr_t, + sigdefault: *const sigset_t, + ) -> c_int; + pub fn posix_spawnattr_getsigdefault( + attr: *const posix_spawnattr_t, + sigdefault: *mut sigset_t, + ) -> c_int; + pub fn posix_spawnattr_setsigignore_np( + attr: *mut posix_spawnattr_t, + sigignore: *const sigset_t, + ) -> c_int; + pub fn posix_spawnattr_getsigignore_np( + attr: *const posix_spawnattr_t, + sigignore: *mut sigset_t, + ) -> c_int; + pub fn posix_spawnattr_setsigmask( + attr: *mut posix_spawnattr_t, + sigmask: *const sigset_t, + ) -> c_int; + pub fn posix_spawnattr_getsigmask( + attr: *const posix_spawnattr_t, + sigmask: *mut sigset_t, + ) -> c_int; + pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; diff --git a/src/unix/solarish/solaris.rs b/src/unix/solarish/solaris.rs index e1cddc385f285..3e57abcfa21c9 100644 --- a/src/unix/solarish/solaris.rs +++ b/src/unix/solarish/solaris.rs @@ -189,6 +189,8 @@ pub const PRIV_TPD_UNSAFE: c_uint = 0x0800; pub const PRIV_PROC_TPD_RESET: c_uint = 0x1000; pub const PRIV_TPD_KILLABLE: c_uint = 0x2000; +pub const POSIX_SPAWN_SETSID: c_short = 0x400; + pub const PRIV_USER: c_uint = PRIV_DEBUG | PRIV_PROC_SENSITIVE | NET_MAC_AWARE diff --git a/src/vxworks/aarch64.rs b/src/vxworks/aarch64.rs index 630c7db54b55b..376783c8234ba 100644 --- a/src/vxworks/aarch64.rs +++ b/src/vxworks/aarch64.rs @@ -1,3 +1 @@ pub type wchar_t = u32; -pub type c_long = i64; -pub type c_ulong = u64; diff --git a/src/vxworks/arm.rs b/src/vxworks/arm.rs index 01fc7262f03e2..376783c8234ba 100644 --- a/src/vxworks/arm.rs +++ b/src/vxworks/arm.rs @@ -1,3 +1 @@ pub type wchar_t = u32; -pub type c_long = i32; -pub type c_ulong = u32; diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index 8d8b76b662568..a9351069e3127 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -14,16 +14,6 @@ impl Clone for DIR { } } -pub type c_schar = i8; -pub type c_uchar = u8; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_int = i32; -pub type c_uint = u32; -pub type c_float = f32; -pub type c_double = f64; -pub type c_longlong = i64; -pub type c_ulonglong = u64; pub type intmax_t = i64; pub type uintmax_t = u64; @@ -44,7 +34,7 @@ pub type ino_t = c_ulong; pub type rlim_t = c_ulong; pub type suseconds_t = c_long; -pub type time_t = c_long; +pub type time_t = c_longlong; pub type errno_t = c_int; diff --git a/src/vxworks/powerpc.rs b/src/vxworks/powerpc.rs index 01fc7262f03e2..376783c8234ba 100644 --- a/src/vxworks/powerpc.rs +++ b/src/vxworks/powerpc.rs @@ -1,3 +1 @@ pub type wchar_t = u32; -pub type c_long = i32; -pub type c_ulong = u32; diff --git a/src/vxworks/powerpc64.rs b/src/vxworks/powerpc64.rs index 630c7db54b55b..376783c8234ba 100644 --- a/src/vxworks/powerpc64.rs +++ b/src/vxworks/powerpc64.rs @@ -1,3 +1 @@ pub type wchar_t = u32; -pub type c_long = i64; -pub type c_ulong = u64; diff --git a/src/vxworks/riscv32.rs b/src/vxworks/riscv32.rs index 741e312afce17..f562626f7fb2b 100644 --- a/src/vxworks/riscv32.rs +++ b/src/vxworks/riscv32.rs @@ -1,3 +1 @@ pub type wchar_t = i32; -pub type c_long = i32; -pub type c_ulong = u32; diff --git a/src/vxworks/riscv64.rs b/src/vxworks/riscv64.rs index 7bacd5c5abec4..f562626f7fb2b 100644 --- a/src/vxworks/riscv64.rs +++ b/src/vxworks/riscv64.rs @@ -1,3 +1 @@ pub type wchar_t = i32; -pub type c_long = i64; -pub type c_ulong = u64; diff --git a/src/vxworks/x86.rs b/src/vxworks/x86.rs index 741e312afce17..f562626f7fb2b 100644 --- a/src/vxworks/x86.rs +++ b/src/vxworks/x86.rs @@ -1,3 +1 @@ pub type wchar_t = i32; -pub type c_long = i32; -pub type c_ulong = u32; diff --git a/src/vxworks/x86_64.rs b/src/vxworks/x86_64.rs index 7bacd5c5abec4..f562626f7fb2b 100644 --- a/src/vxworks/x86_64.rs +++ b/src/vxworks/x86_64.rs @@ -1,3 +1 @@ pub type wchar_t = i32; -pub type c_long = i64; -pub type c_ulong = u64; diff --git a/src/wasi/mod.rs b/src/wasi/mod.rs index 750fdfb55fe5d..1a103cc85fe90 100644 --- a/src/wasi/mod.rs +++ b/src/wasi/mod.rs @@ -7,16 +7,6 @@ use core::iter::Iterator; use crate::prelude::*; -pub type c_uchar = u8; -pub type c_schar = i8; -pub type c_int = i32; -pub type c_uint = u32; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_long = i32; -pub type c_ulong = u32; -pub type c_longlong = i64; -pub type c_ulonglong = u64; pub type intmax_t = i64; pub type uintmax_t = u64; pub type size_t = usize; @@ -28,8 +18,6 @@ pub type off_t = i64; pub type pid_t = i32; pub type clock_t = c_longlong; pub type time_t = c_longlong; -pub type c_double = f64; -pub type c_float = f32; pub type ino_t = u64; pub type sigset_t = c_uchar; pub type suseconds_t = c_longlong; diff --git a/src/windows/mod.rs b/src/windows/mod.rs index b07b5a98dc49e..9161b32ca0ce6 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -2,16 +2,6 @@ use crate::prelude::*; -pub type c_schar = i8; -pub type c_uchar = u8; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_int = i32; -pub type c_uint = u32; -pub type c_float = f32; -pub type c_double = f64; -pub type c_longlong = i64; -pub type c_ulonglong = u64; pub type intmax_t = i64; pub type uintmax_t = u64; @@ -22,8 +12,6 @@ pub type uintptr_t = usize; pub type ssize_t = isize; pub type sighandler_t = usize; -pub type c_long = i32; -pub type c_ulong = u32; pub type wchar_t = u16; pub type clock_t = i32; diff --git a/src/xous.rs b/src/xous.rs index 468865c8d4131..35350a723c8e9 100644 --- a/src/xous.rs +++ b/src/xous.rs @@ -1,15 +1,5 @@ //! Xous C type definitions -pub type c_schar = i8; -pub type c_uchar = u8; -pub type c_short = i16; -pub type c_ushort = u16; -pub type c_int = i32; -pub type c_uint = u32; -pub type c_float = f32; -pub type c_double = f64; -pub type c_longlong = i64; -pub type c_ulonglong = u64; pub type intmax_t = i64; pub type uintmax_t = u64; @@ -20,8 +10,6 @@ pub type uintptr_t = usize; pub type ssize_t = isize; pub type off_t = i64; -pub type c_long = i64; -pub type c_ulong = u64; pub type wchar_t = u32; pub const INT_MIN: c_int = -2147483648;