summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/bors.yml32
-rw-r--r--.github/workflows/main.yml2
-rw-r--r--ci/build.sh22
-rw-r--r--libc-test/build.rs13
-rw-r--r--libc-test/semver/android.txt21
-rw-r--r--libc-test/semver/apple.txt10
-rw-r--r--libc-test/semver/linux.txt7
-rw-r--r--libc-test/semver/netbsd.txt23
-rw-r--r--src/unix/bsd/apple/mod.rs25
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs159
-rw-r--r--src/unix/linux_like/android/mod.rs27
-rw-r--r--src/unix/linux_like/emscripten/mod.rs6
-rw-r--r--src/unix/linux_like/linux/mod.rs14
-rw-r--r--src/unix/linux_like/mod.rs8
-rw-r--r--src/windows/msvc/x86_64/align.rs (renamed from src/windows/msvc/x86_64.rs)12
-rw-r--r--src/windows/msvc/x86_64/mod.rs6
16 files changed, 358 insertions, 29 deletions
diff --git a/.github/workflows/bors.yml b/.github/workflows/bors.yml
index 5bbf286c86..25852318e2 100644
--- a/.github/workflows/bors.yml
+++ b/.github/workflows/bors.yml
@@ -29,7 +29,7 @@ jobs:
macos:
name: macOS
- runs-on: macos-10.15
+ runs-on: macos-11
strategy:
fail-fast: true
matrix:
@@ -199,7 +199,7 @@ jobs:
build_channels_macos:
name: Build Channels macOS
needs: macos
- runs-on: macos-10.15
+ runs-on: macos-11
env:
OS: macos
strategy:
@@ -226,6 +226,30 @@ jobs:
- name: Execute build.sh
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
+ build_channels_windows:
+ name: Build Channels Windows
+ runs-on: windows-2019
+ env:
+ OS: windows
+ strategy:
+ fail-fast: true
+ matrix:
+ toolchain: [
+ 1.19.0,
+ 1.24.0,
+ 1.25.0,
+ 1.30.0,
+ stable,
+ ]
+ steps:
+ - uses: actions/checkout@v2
+ - name: Self-update rustup
+ run: rustup self update
+ shell: bash
+ - name: Execute build.sh
+ run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} WIN_TARGET=${{ matrix.target }} sh ./ci/build.sh
+ shell: bash
+
semver_linux:
name: Semver Linux
runs-on: ubuntu-20.04
@@ -240,7 +264,7 @@ jobs:
semver_macos:
name: Semver macOS
- runs-on: macos-10.15
+ runs-on: macos-11
continue-on-error: true
steps:
- uses: actions/checkout@v2
@@ -283,6 +307,7 @@ jobs:
docker_switch,
build_channels_linux,
build_channels_macos,
+ build_channels_windows,
docs,
]
@@ -303,6 +328,7 @@ jobs:
docker_switch,
build_channels_linux,
build_channels_macos,
+ build_channels_windows,
docs,
]
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 0abb9a7d50..52a66ae3c9 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -27,7 +27,7 @@ jobs:
macos:
name: macOS
- runs-on: macos-10.15
+ runs-on: macos-11
strategy:
fail-fast: true
matrix:
diff --git a/ci/build.sh b/ci/build.sh
index 51ce8bc348..21c08fbeb3 100644
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -161,6 +161,13 @@ RUST_NIGHTLY_APPLE_TARGETS="\
aarch64-apple-darwin \
"
+# Must start with `x86_64-pc-windows-msvc` first.
+RUST_NIGHTLY_WINDOWS_TARGETS="\
+x86_64-pc-windows-msvc \
+x86_64-pc-windows-gnu \
+i686-pc-windows-msvc \
+"
+
# The targets are listed here alphabetically
TARGETS=""
case "${OS}" in
@@ -190,13 +197,22 @@ case "${OS}" in
fi
;;
+ windows*)
+ TARGETS=${RUST_NIGHTLY_WINDOWS_TARGETS}
+
+ ;;
*)
;;
esac
for TARGET in $TARGETS; do
if echo "$TARGET"|grep -q "$FILTER"; then
- test_target build "$TARGET"
+ if [ "${OS}" = "windows" ]; then
+ TARGET="$TARGET" sh ./ci/install-rust.sh
+ test_target build "$TARGET"
+ else
+ test_target build "$TARGET"
+ fi
fi
done
@@ -265,7 +281,7 @@ if [ "${RUST}" = "nightly" ] && [ "${OS}" = "linux" ]; then
done
fi
-RUST_OSX_NO_CORE_TARGETS="\
+RUST_APPLE_NO_CORE_TARGETS="\
armv7-apple-ios \
armv7s-apple-ios \
i686-apple-darwin \
@@ -273,7 +289,7 @@ i386-apple-ios \
"
if [ "${RUST}" = "nightly" ] && [ "${OS}" = "macos" ]; then
- for TARGET in $RUST_OSX_NO_CORE_TARGETS; do
+ for TARGET in $RUST_APPLE_NO_CORE_TARGETS; do
if echo "$TARGET" | grep -q "$FILTER"; then
test_target build "$TARGET" 1
fi
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 7de5f2ef99..2cfac7a752 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -221,6 +221,7 @@ fn test_apple(target: &str) {
"poll.h",
"pthread.h",
"pthread_spis.h",
+ "pthread/introspection.h",
"pwd.h",
"regex.h",
"resolv.h",
@@ -284,6 +285,10 @@ fn test_apple(target: &str) {
}
});
+ cfg.skip_type(move |ty| match ty {
+ _ => false,
+ });
+
cfg.skip_const(move |name| {
// They're declared via `deprecated_mach` and we don't support it anymore.
if name.starts_with("VM_FLAGS_") {
@@ -295,8 +300,6 @@ fn test_apple(target: &str) {
"KERN_KDENABLE_BG_TRACE" | "KERN_KDDISABLE_BG_TRACE" => true,
// FIXME: the value has been changed since Catalina (0xffff0000 -> 0x3fff0000).
"SF_SETTABLE" => true,
- // FIXME: the values have been changed since Big Sur
- "HW_TARGET" | "HW_PRODUCT" | "HW_MAXID" => true,
_ => false,
}
});
@@ -310,9 +313,6 @@ fn test_apple(target: &str) {
// close calls the close_nocancel system call
"close" => true,
- // these calls require macOS 11.0 or higher
- "preadv" | "pwritev" => true,
-
_ => false,
}
});
@@ -479,6 +479,8 @@ fn test_openbsd(target: &str) {
match name {
// Removed in OpenBSD 6.0
"KERN_USERMOUNT" | "KERN_ARND" => true,
+ // Good chance it's going to be wrong depending on the host release
+ "KERN_MAXID" | "NET_RT_MAXID" => true,
_ => false,
}
});
@@ -2568,6 +2570,7 @@ fn test_linux(target: &str) {
cfg:
"asm/mman.h",
"linux/can.h",
+ "linux/can/raw.h",
"linux/dccp.h",
"linux/errqueue.h",
"linux/falloc.h",
diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt
index b9845e9414..9bbe6b10e1 100644
--- a/libc-test/semver/android.txt
+++ b/libc-test/semver/android.txt
@@ -430,6 +430,7 @@ EPFNOSUPPORT
EPIPE
EPOLLERR
EPOLLET
+EPOLLEXCLUSIVE
EPOLLHUP
EPOLLIN
EPOLLMSG
@@ -1129,18 +1130,23 @@ NCP_SUPER_MAGIC
NETLINK_ADD_MEMBERSHIP
NETLINK_AUDIT
NETLINK_BROADCAST_ERROR
+NETLINK_CAP_ACK
NETLINK_CONNECTOR
NETLINK_CRYPTO
NETLINK_DNRTMSG
NETLINK_DROP_MEMBERSHIP
NETLINK_ECRYPTFS
+NETLINK_EXT_ACK
NETLINK_FIB_LOOKUP
NETLINK_FIREWALL
NETLINK_GENERIC
+NETLINK_GET_STRICT_CHK
NETLINK_INET_DIAG
NETLINK_IP6_FW
NETLINK_ISCSI
NETLINK_KOBJECT_UEVENT
+NETLINK_LISTEN_ALL_NSID
+NETLINK_LIST_MEMBERSHIPS
NETLINK_NETFILTER
NETLINK_NFLOG
NETLINK_NO_ENOBUFS
@@ -1677,6 +1683,21 @@ PTRACE_SETSIGINFO
PTRACE_SINGLESTEP
PTRACE_SYSCALL
PTRACE_TRACEME
+PT_HIOS
+PT_LOPROC
+PT_HIPROC
+PT_DYNAMIC
+PT_GNU_EH_FRAME
+PT_GNU_RELRO
+PT_GNU_STACK
+PT_INTERP
+PT_LOAD
+PT_LOOS
+PT_NOTE
+PT_NULL
+PT_PHDR
+PT_SHLIB
+PT_TLS
P_ALL
P_PGID
P_PID
diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt
index 5bbb7bf1eb..8592469ddb 100644
--- a/libc-test/semver/apple.txt
+++ b/libc-test/semver/apple.txt
@@ -942,6 +942,10 @@ PROC_PIDTASKINFO
PROC_PIDTHREADINFO
PTHREAD_CREATE_DETACHED
PTHREAD_CREATE_JOINABLE
+PTHREAD_INTROSPECTION_THREAD_CREATE
+PTHREAD_INTROSPECTION_THREAD_DESTROY
+PTHREAD_INTROSPECTION_THREAD_START
+PTHREAD_INTROSPECTION_THREAD_TERMINATE
PTHREAD_MUTEX_DEFAULT
PTHREAD_MUTEX_ERRORCHECK
PTHREAD_PROCESS_PRIVATE
@@ -1043,10 +1047,12 @@ RTF_BLACKHOLE
RTF_BROADCAST
RTF_CLONING
RTF_CONDEMNED
+RTF_DEAD
RTF_DELCLONE
RTF_DONE
RTF_DYNAMIC
RTF_GATEWAY
+RTF_GLOBAL
RTF_HOST
RTF_IFREF
RTF_IFSCOPE
@@ -1824,6 +1830,10 @@ pthread_attr_getschedparam
pthread_attr_setschedparam
pthread_create_from_mach_thread
pthread_getschedparam
+pthread_introspection_getspecific_np
+pthread_introspection_hook_t
+pthread_introspection_hook_install
+pthread_introspection_setspecific_np
pthread_setschedparam
pthread_cancel
pthread_condattr_getpshared
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 780181a509..08b79ba28d 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -219,6 +219,12 @@ CAN_SFF_ID_BITS
CAN_SFF_MASK
CAN_TP16
CAN_TP20
+CAN_RAW_FILTER
+CAN_RAW_ERR_FILTER
+CAN_RAW_LOOPBACK
+CAN_RAW_RECV_OWN_MSGS
+CAN_RAW_FD_FRAMES
+CAN_RAW_JOIN_FILTERS
CBAUD
CBAUDEX
CLD_CONTINUED
@@ -2025,6 +2031,7 @@ SOL_ALG
SOL_ATM
SOL_BLUETOOTH
SOL_CAN_BASE
+SOL_CAN_RAW
SOL_DCCP
SOL_DECNET
SOL_ICMPV6
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index 4f072f1c04..eb99d6539f 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -1274,6 +1274,29 @@ pipe2
pollts
popen
posix_madvise
+posix_spawn
+posix_spawn_file_actions_entry_t
+posix_spawn_file_actions_addclose
+posix_spawn_file_actions_adddup2
+posix_spawn_file_actions_addopen
+posix_spawn_file_actions_destroy
+posix_spawn_file_actions_init
+posix_spawn_file_actions_t
+posix_spawnattr_destroy
+posix_spawnattr_getflags
+posix_spawnattr_getpgroup
+posix_spawnattr_getschedparam
+posix_spawnattr_getschedpolicy
+posix_spawnattr_getsigdefault
+posix_spawnattr_getsigmask
+posix_spawnattr_init
+posix_spawnattr_setflags
+posix_spawnattr_setpgroup
+posix_spawnattr_setschedparam
+posix_spawnattr_setschedpolicy
+posix_spawnattr_setsigdefault
+posix_spawnattr_setsigmask
+posix_spawnattr_t
preadv
pseudo_AF_HDRCMPLT
pseudo_AF_KEY
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index d735db77f9..51319a5b6d 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -112,6 +112,9 @@ pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy;
pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy;
pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy;
+pub type pthread_introspection_hook_t =
+ extern "C" fn(event: ::c_uint, thread: ::pthread_t, addr: *mut ::c_void, size: ::size_t);
+
pub type vm_statistics_t = *mut vm_statistics;
pub type vm_statistics_data_t = vm_statistics;
pub type vm_statistics64_t = *mut vm_statistics64;
@@ -2959,6 +2962,11 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040;
pub const AT_REMOVEDIR: ::c_int = 0x0080;
+pub const PTHREAD_INTROSPECTION_THREAD_CREATE: ::c_uint = 1;
+pub const PTHREAD_INTROSPECTION_THREAD_START: ::c_uint = 2;
+pub const PTHREAD_INTROSPECTION_THREAD_TERMINATE: ::c_uint = 3;
+pub const PTHREAD_INTROSPECTION_THREAD_DESTROY: ::c_uint = 4;
+
pub const TIOCMODG: ::c_ulong = 0x40047403;
pub const TIOCMODS: ::c_ulong = 0x80047404;
pub const TIOCM_LE: ::c_int = 0x1;
@@ -4229,6 +4237,8 @@ pub const RTF_CONDEMNED: ::c_int = 0x2000000;
pub const RTF_IFREF: ::c_int = 0x4000000;
pub const RTF_PROXY: ::c_int = 0x8000000;
pub const RTF_ROUTER: ::c_int = 0x10000000;
+pub const RTF_DEAD: ::c_int = 0x20000000;
+pub const RTF_GLOBAL: ::c_int = 0x40000000;
pub const RTM_VERSION: ::c_int = 5;
@@ -4849,6 +4859,21 @@ extern "C" {
policy: ::c_int,
param: *const sched_param,
) -> ::c_int;
+
+ // Available from Big Sur
+ pub fn pthread_introspection_hook_install(
+ hook: ::pthread_introspection_hook_t,
+ ) -> ::pthread_introspection_hook_t;
+ pub fn pthread_introspection_setspecific_np(
+ thread: ::pthread_t,
+ key: ::pthread_key_t,
+ value: *const ::c_void,
+ ) -> ::c_int;
+ pub fn pthread_introspection_getspecific_np(
+ thread: ::pthread_t,
+ key: ::pthread_key_t,
+ ) -> *mut ::c_void;
+
pub fn thread_policy_set(
thread: thread_t,
flavor: thread_policy_flavor_t,
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 2fa9d853d4..9dff434261 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -35,6 +35,14 @@ pub type Elf64_Xword = u64;
pub type iconv_t = *mut ::c_void;
+e! {
+ pub enum fae_action {
+ FAE_OPEN,
+ FAE_DUP2,
+ FAE_CLOSE,
+ }
+}
+
cfg_if! {
if #[cfg(target_pointer_width = "64")] {
type Elf_Addr = Elf64_Addr;
@@ -497,6 +505,39 @@ s! {
pub kve_vn_mode: u32,
pub kve_path: [[::c_char; 32]; 32],
}
+
+ pub struct __c_anonymous_posix_spawn_fae_open {
+ pub path: *mut ::c_char,
+ pub oflag: ::c_int,
+ pub mode: ::mode_t,
+ }
+
+ pub struct __c_anonymous_posix_spawn_fae_dup2 {
+ pub newfildes: ::c_int,
+ }
+
+ pub struct posix_spawnattr_t {
+ pub sa_flags: ::c_short,
+ pub sa_pgroup: ::pid_t,
+ pub sa_schedparam: sched_param,
+ pub sa_schedpolicy: ::c_int,
+ pub sa_sigdefault: sigset_t,
+ pub sa_sigmask: sigset_t,
+ }
+
+ pub struct posix_spawn_file_actions_entry_t {
+ pub fae_action: fae_action,
+ pub fae_fildes: ::c_int,
+ #[cfg(libc_union)]
+ pub fae_data: __c_anonymous_posix_spawn_fae,
+ }
+
+ pub struct posix_spawn_file_actions_t {
+ pub size: ::c_uint,
+ pub len: ::c_uint,
+ #[cfg(libc_union)]
+ pub fae: *mut posix_spawn_file_actions_entry_t,
+ }
}
s_no_extra_traits! {
@@ -609,6 +650,12 @@ s_no_extra_traits! {
__unused1: *mut ::c_void, //actually a function pointer
pub sigev_notify_attributes: *mut ::c_void
}
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_posix_spawn_fae {
+ pub open: __c_anonymous_posix_spawn_fae_open,
+ pub dup2: __c_anonymous_posix_spawn_fae_dup2,
+ }
}
cfg_if! {
@@ -1036,6 +1083,41 @@ cfg_if! {
self.sigev_notify_attributes.hash(state);
}
}
+
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_posix_spawn_fae {}
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_posix_spawn_fae {
+ fn eq(&self, other: &__c_anonymous_posix_spawn_fae) -> bool {
+ unsafe {
+ self.open == other.open
+ || self.dup2 == other.dup2
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_posix_spawn_fae {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("__c_anonymous_posix_fae")
+ .field("open", &self.open)
+ .field("dup2", &self.dup2)
+ .finish()
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_posix_spawn_fae {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ unsafe {
+ self.open.hash(state);
+ self.dup2.hash(state);
+ }
+ }
+ }
}
}
@@ -2307,6 +2389,83 @@ extern "C" {
ts: *const ::timespec,
sigmask: *const ::sigset_t,
) -> ::c_int;
+
+ pub fn posix_spawn(
+ pid: *mut ::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 ::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_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_getsigdefault(
+ attr: *const posix_spawnattr_t,
+ default: *mut ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setsigdefault(
+ attr: *mut posix_spawnattr_t,
+ default: *const ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getsigmask(
+ attr: *const posix_spawnattr_t,
+ default: *mut ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setsigmask(
+ attr: *mut posix_spawnattr_t,
+ default: *const ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getflags(
+ attr: *const posix_spawnattr_t,
+ flags: *mut ::c_short,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+ pub fn posix_spawnattr_getpgroup(
+ attr: *const posix_spawnattr_t,
+ flags: *mut ::pid_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+ pub fn posix_spawnattr_getschedpolicy(
+ attr: *const posix_spawnattr_t,
+ flags: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
+ pub fn posix_spawnattr_getschedparam(
+ attr: *const posix_spawnattr_t,
+ param: *mut ::sched_param,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setschedparam(
+ attr: *mut posix_spawnattr_t,
+ param: *const ::sched_param,
+ ) -> ::c_int;
+
+ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+ pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+ pub fn posix_spawn_file_actions_addopen(
+ actions: *mut posix_spawn_file_actions_t,
+ fd: ::c_int,
+ path: *const ::c_char,
+ oflag: ::c_int,
+ mode: ::mode_t,
+ ) -> ::c_int;
+ pub fn posix_spawn_file_actions_addclose(
+ actions: *mut posix_spawn_file_actions_t,
+ fd: ::c_int,
+ ) -> ::c_int;
+ pub fn posix_spawn_file_actions_adddup2(
+ actions: *mut posix_spawn_file_actions_t,
+ fd: ::c_int,
+ newfd: ::c_int,
+ ) -> ::c_int;
}
#[link(name = "util")]
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index 5e6fae7dae..6faadb9b88 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -792,9 +792,6 @@ pub const EPROTO: ::c_int = 71;
pub const EDOTDOT: ::c_int = 73;
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
-pub const EPOLLONESHOT: ::c_int = 0x40000000;
-pub const EPOLLRDHUP: ::c_int = 0x00002000;
-pub const EPOLLWAKEUP: ::c_int = 0x20000000;
// sys/eventfd.h
pub const EFD_SEMAPHORE: ::c_int = 0x1;
@@ -1787,6 +1784,11 @@ pub const NETLINK_BROADCAST_ERROR: ::c_int = 4;
pub const NETLINK_NO_ENOBUFS: ::c_int = 5;
pub const NETLINK_RX_RING: ::c_int = 6;
pub const NETLINK_TX_RING: ::c_int = 7;
+pub const NETLINK_LISTEN_ALL_NSID: ::c_int = 8;
+pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9;
+pub const NETLINK_CAP_ACK: ::c_int = 10;
+pub const NETLINK_EXT_ACK: ::c_int = 11;
+pub const NETLINK_GET_STRICT_CHK: ::c_int = 12;
pub const GRND_NONBLOCK: ::c_uint = 0x0001;
pub const GRND_RANDOM: ::c_uint = 0x0002;
@@ -1867,6 +1869,25 @@ pub const MFD_CLOEXEC: ::c_uint = 0x0001;
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
pub const MFD_HUGETLB: ::c_uint = 0x0004;
+// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has
+// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32
+// so we can use that type here to avoid having to cast.
+pub const PT_NULL: u32 = 0;
+pub const PT_LOAD: u32 = 1;
+pub const PT_DYNAMIC: u32 = 2;
+pub const PT_INTERP: u32 = 3;
+pub const PT_NOTE: u32 = 4;
+pub const PT_SHLIB: u32 = 5;
+pub const PT_PHDR: u32 = 6;
+pub const PT_TLS: u32 = 7;
+pub const PT_LOOS: u32 = 0x60000000;
+pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
+pub const PT_GNU_STACK: u32 = 0x6474e551;
+pub const PT_GNU_RELRO: u32 = 0x6474e552;
+pub const PT_HIOS: u32 = 0x6fffffff;
+pub const PT_LOPROC: u32 = 0x70000000;
+pub const PT_HIPROC: u32 = 0x7fffffff;
+
// linux/netfilter.h
pub const NF_DROP: ::c_int = 0;
pub const NF_ACCEPT: ::c_int = 1;
diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs
index b83415a393..5494aad378 100644
--- a/src/unix/linux_like/emscripten/mod.rs
+++ b/src/unix/linux_like/emscripten/mod.rs
@@ -965,10 +965,6 @@ pub const SHM_UNLOCK: ::c_int = 12;
pub const SHM_HUGETLB: ::c_int = 0o4000;
pub const SHM_NORESERVE: ::c_int = 0o10000;
-pub const EPOLLRDHUP: ::c_int = 0x2000;
-pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
-pub const EPOLLONESHOT: ::c_int = 0x40000000;
-
pub const QFMT_VFS_OLD: ::c_int = 1;
pub const QFMT_VFS_V0: ::c_int = 2;
@@ -1372,8 +1368,6 @@ pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
pub const PTRACE_LISTEN: ::c_int = 0x4208;
pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
-pub const EPOLLWAKEUP: ::c_int = 0x20000000;
-
pub const PTRACE_GETFPREGS: ::c_uint = 14;
pub const PTRACE_SETFPREGS: ::c_uint = 15;
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 2630942bd4..5f725f0e67 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -1551,11 +1551,6 @@ pub const SHM_HUGETLB: ::c_int = 0o4000;
#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))]
pub const SHM_NORESERVE: ::c_int = 0o10000;
-pub const EPOLLRDHUP: ::c_int = 0x2000;
-pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
-pub const EPOLLWAKEUP: ::c_int = 0x20000000;
-pub const EPOLLONESHOT: ::c_int = 0x40000000;
-
pub const QFMT_VFS_OLD: ::c_int = 1;
pub const QFMT_VFS_V0: ::c_int = 2;
pub const QFMT_VFS_V1: ::c_int = 4;
@@ -3074,6 +3069,15 @@ pub const SOL_CAN_BASE: ::c_int = 100;
pub const CAN_INV_FILTER: canid_t = 0x20000000;
pub const CAN_RAW_FILTER_MAX: ::c_int = 512;
+// linux/can/raw.h
+pub const SOL_CAN_RAW: ::c_int = SOL_CAN_BASE + CAN_RAW;
+pub const CAN_RAW_FILTER: ::c_int = 1;
+pub const CAN_RAW_ERR_FILTER: ::c_int = 2;
+pub const CAN_RAW_LOOPBACK: ::c_int = 3;
+pub const CAN_RAW_RECV_OWN_MSGS: ::c_int = 4;
+pub const CAN_RAW_FD_FRAMES: ::c_int = 5;
+pub const CAN_RAW_JOIN_FILTERS: ::c_int = 6;
+
#[deprecated(
since = "0.2.102",
note = "Errnoeously uses c_int; should use c_short."
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index 5940424721..6df7ca0aef 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -1028,13 +1028,17 @@ pub const FD_SETSIZE: usize = 1024;
pub const EPOLLIN: ::c_int = 0x1;
pub const EPOLLPRI: ::c_int = 0x2;
pub const EPOLLOUT: ::c_int = 0x4;
+pub const EPOLLERR: ::c_int = 0x8;
+pub const EPOLLHUP: ::c_int = 0x10;
pub const EPOLLRDNORM: ::c_int = 0x40;
pub const EPOLLRDBAND: ::c_int = 0x80;
pub const EPOLLWRNORM: ::c_int = 0x100;
pub const EPOLLWRBAND: ::c_int = 0x200;
pub const EPOLLMSG: ::c_int = 0x400;
-pub const EPOLLERR: ::c_int = 0x8;
-pub const EPOLLHUP: ::c_int = 0x10;
+pub const EPOLLRDHUP: ::c_int = 0x2000;
+pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
+pub const EPOLLWAKEUP: ::c_int = 0x20000000;
+pub const EPOLLONESHOT: ::c_int = 0x40000000;
pub const EPOLLET: ::c_int = 0x80000000;
pub const EPOLL_CTL_ADD: ::c_int = 1;
diff --git a/src/windows/msvc/x86_64.rs b/src/windows/msvc/x86_64/align.rs
index 249e590165..fde7b8f3e5 100644
--- a/src/windows/msvc/x86_64.rs
+++ b/src/windows/msvc/x86_64/align.rs
@@ -1,3 +1,4 @@
+#[allow(deprecated)]
pub type XMM_SAVE_AREA32 = XSAVE_FORMAT;
s_no_extra_traits! {
@@ -40,12 +41,18 @@ cfg_if! {
}
s! {
+ #[doc(hidden)]
+ #[deprecated(since = "0.2.104", note = "use the `winapi` crate instead; we're going to
+remove it in a future release")]
#[repr(align(16))]
pub struct M128A {
pub Low: ::c_ulonglong,
pub High: ::c_longlong,
}
+ #[doc(hidden)]
+ #[deprecated(since = "0.2.104", note = "use the `winapi` crate instead; we're going to
+remove it in a future release")]
#[repr(align(16))]
pub struct XSAVE_FORMAT {
pub ControlWord: ::c_ushort,
@@ -63,7 +70,7 @@ s! {
pub MxCsr_Mask: ::c_ulong,
pub FloatRegisters: [M128A; 8],
pub XmmRegisters: [M128A; 16],
- _Reserved4: [::c_uchar; 96],
+ _Reserved4: [[::c_uchar; 16]; 6],
}
#[repr(align(16))]
@@ -88,6 +95,9 @@ s! {
pub Xmm15: M128A,
}
+ #[doc(hidden)]
+ #[deprecated(since = "0.2.104", note = "use the `winapi` crate instead; we're going to
+remove it in a future release")]
#[repr(align(16))]
pub struct CONTEXT {
pub P1Home: u64,
diff --git a/src/windows/msvc/x86_64/mod.rs b/src/windows/msvc/x86_64/mod.rs
new file mode 100644
index 0000000000..45447da34f
--- /dev/null
+++ b/src/windows/msvc/x86_64/mod.rs
@@ -0,0 +1,6 @@
+cfg_if! {
+ if #[cfg(libc_align)] {
+ mod align;
+ pub use self::align::*;
+ }
+}