From 839239da6b507e443390576c1392147c0d252e0d Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Fri, 11 Oct 2024 10:40:15 +0200 Subject: [PATCH] emscripten: Upgrade emsdk to 3.1.68 In line with commit rust-lang/rust@2c38ecfc9077000db7de14bf501fa5294eeecedd. While we're here, make the changes in commit 63b0d67 unconditional, which means that Emscripten 3.1.42 (released at 2023/06/23) is the minimum required version for Rust, assuming no breaking ABI changes occurred after that version. --- build.rs | 29 ------ ci/emscripten.sh | 6 +- libc-test/build.rs | 114 +++++++++--------------- src/unix/linux_like/emscripten/align.rs | 6 +- src/unix/linux_like/emscripten/mod.rs | 111 +++++++++++++---------- 5 files changed, 109 insertions(+), 157 deletions(-) diff --git a/build.rs b/build.rs index eb602cd37a491..0c3650d29a849 100644 --- a/build.rs +++ b/build.rs @@ -6,7 +6,6 @@ use std::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", "espidf_time64", "freebsd10", "freebsd11", @@ -67,12 +66,6 @@ fn main() { _ => set_cfg("freebsd15"), } - match emcc_version_code() { - Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"), - // Non-Emscripten or version < 3.1.42. - Some(_) | None => (), - } - // On CI: deny all warnings if libc_ci { set_cfg("libc_deny_warnings"); @@ -212,28 +205,6 @@ fn which_freebsd() -> Option { } } -fn emcc_version_code() -> Option { - let output = std::process::Command::new("emcc") - .arg("-dumpversion") - .output() - .ok()?; - if !output.status.success() { - return None; - } - - let version = String::from_utf8(output.stdout).ok()?; - - // Some Emscripten versions come with `-git` attached, so split the - // version string also on the `-` char. - let mut pieces = version.trim().split(['.', '-']); - - let major = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0); - let minor = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0); - let patch = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0); - - Some(major * 10000 + minor * 100 + patch) -} - fn set_cfg(cfg: &str) { if !ALLOWED_CFGS.contains(&cfg) { panic!("trying to set cfg {}, but it is not in ALLOWED_CFGS", cfg); diff --git a/ci/emscripten.sh b/ci/emscripten.sh index 44da97c93ee68..b99d2cfbe5397 100644 --- a/ci/emscripten.sh +++ b/ci/emscripten.sh @@ -2,9 +2,9 @@ set -ex -# FIXME: 3.1.21 removed a lot of header files (https://github.com/emscripten-core/emscripten/pull/17704). -# We have to tweak libc-test (and deprecate unsupported items, maybe) when updating emsdk. -EMSDK_VERSION=3.1.20 +# Note: keep in sync with: +# https://github.com/rust-lang/rust/blob/master/src/ci/docker/scripts/emscripten.sh +EMSDK_VERSION=3.1.68 git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable cd /emsdk-portable diff --git a/libc-test/build.rs b/libc-test/build.rs index 07621d5927d8b..0a81a5356fd43 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2703,7 +2703,6 @@ fn test_emscripten(target: &str) { cfg.define("_GNU_SOURCE", None); // FIXME: ?? headers! { cfg: - "aio.h", "ctype.h", "dirent.h", "dlfcn.h", @@ -2743,32 +2742,21 @@ fn test_emscripten(target: &str) { "stdio.h", "stdlib.h", "string.h", - "sys/epoll.h", - "sys/eventfd.h", "sys/file.h", "sys/ioctl.h", "sys/ipc.h", "sys/mman.h", "sys/mount.h", "sys/msg.h", - "sys/personality.h", - "sys/prctl.h", - "sys/ptrace.h", - "sys/quota.h", - "sys/reboot.h", "sys/resource.h", "sys/sem.h", "sys/shm.h", - "sys/signalfd.h", "sys/socket.h", "sys/stat.h", "sys/statvfs.h", - "sys/swap.h", "sys/syscall.h", - "sys/sysctl.h", "sys/sysinfo.h", "sys/time.h", - "sys/timerfd.h", "sys/times.h", "sys/types.h", "sys/uio.h", @@ -2794,9 +2782,7 @@ fn test_emscripten(target: &str) { // Just pass all these through, no need for a "struct" prefix "FILE" | "fd_set" | "Dl_info" | "DIR" => ty.to_string(), - "os_unfair_lock" => "struct os_unfair_lock_s".to_string(), - - // LFS64 types have been removed in Emscripten 3.1.44+ + // LFS64 types have been removed in Emscripten 3.1.44 // https://github.com/emscripten-core/emscripten/pull/19812 "off64_t" => "off_t".to_string(), @@ -2820,7 +2806,7 @@ fn test_emscripten(target: &str) { s if s.ends_with("_nsec") && struct_.starts_with("stat") => { s.replace("e_nsec", ".tv_nsec") } - // FIXME: appears that `epoll_event.data` is an union + // Rust struct uses raw u64, rather than union "u64" if struct_ == "epoll_event" => "data.u64".to_string(), s => s.to_string(), } @@ -2832,10 +2818,11 @@ fn test_emscripten(target: &str) { // FIXME: is this necessary? "sighandler_t" => true, - // FIXME: The size has been changed due to musl's time64 - "time_t" => true, + // No epoll support + // https://github.com/emscripten-core/emscripten/issues/5033 + ty if ty.starts_with("epoll") => true, - // LFS64 types have been removed in Emscripten 3.1.44+ + // LFS64 types have been removed in Emscripten 3.1.44 // https://github.com/emscripten-core/emscripten/pull/19812 t => t.ends_with("64") || t.ends_with("64_t"), } @@ -2844,29 +2831,19 @@ fn test_emscripten(target: &str) { cfg.skip_struct(move |ty| { match ty { // This is actually a union, not a struct - // FIXME: is this necessary? "sigval" => true, - // FIXME: It was removed in - // emscripten-core/emscripten@953e414 - "pthread_mutexattr_t" => true, - // FIXME: Investigate why the test fails. // Skip for now to unblock CI. "pthread_condattr_t" => true, + "pthread_mutexattr_t" => true, - // FIXME: The size has been changed when upgraded to musl 1.2.2 - "pthread_mutex_t" => true, - - // FIXME: Lowered from 16 to 8 bytes in - // llvm/llvm-project@d1a96e9 - "max_align_t" => true, - - // FIXME: The size has been changed due to time64 - "utimbuf" | "timeval" | "timespec" | "rusage" | "itimerval" | "sched_param" - | "stat" | "stat64" | "shmid_ds" | "msqid_ds" => true, + // No epoll support + // https://github.com/emscripten-core/emscripten/issues/5033 + ty if ty.starts_with("epoll") => true, + ty if ty.starts_with("signalfd") => true, - // LFS64 types have been removed in Emscripten 3.1.44+ + // LFS64 types have been removed in Emscripten 3.1.44 // https://github.com/emscripten-core/emscripten/pull/19812 ty => ty.ends_with("64") || ty.ends_with("64_t"), } @@ -2875,12 +2852,9 @@ fn test_emscripten(target: &str) { cfg.skip_fn(move |name| { match name { // Emscripten does not support fork/exec/wait or any kind of multi-process support - // https://github.com/emscripten-core/emscripten/blob/3.1.30/tools/system_libs.py#L973 + // https://github.com/emscripten-core/emscripten/blob/3.1.68/tools/system_libs.py#L1100 "execv" | "execve" | "execvp" | "execvpe" | "fexecve" | "wait4" => true, - // FIXME: Remove after emscripten-core/emscripten#18492 is released (> 3.1.30). - "clearenv" => true, - _ => false, } }); @@ -2894,23 +2868,35 @@ fn test_emscripten(target: &str) { // FIXME: emscripten uses different constants to constructs these n if n.contains("__SIZEOF_PTHREAD") => true, - // FIXME: `SYS_gettid` was removed in - // emscripten-core/emscripten@6d6474e + // No epoll support + // https://github.com/emscripten-core/emscripten/issues/5033 + n if n.starts_with("EPOLL") => true, + + // No ptrace.h + // https://github.com/emscripten-core/emscripten/pull/17704 + n if n.starts_with("PTRACE_") => true, + + // No quota.h + // https://github.com/emscripten-core/emscripten/pull/17704 + n if n.starts_with("QIF_") => true, + + // `SYS_gettid` was removed in Emscripten v1.39.9 + // https://github.com/emscripten-core/emscripten/pull/10439 "SYS_gettid" => true, - // FIXME: These values have been changed - | "POSIX_MADV_DONTNEED" // to 4 - | "RLIMIT_NLIMITS" // to 16 - | "RLIM_NLIMITS" // to 16 - | "IPPROTO_MAX" // to 263 - | "F_GETLK" // to 5 - | "F_SETLK" // to 6 - | "F_SETLKW" // to 7 - | "O_TMPFILE" // to 65 - | "SIG_IGN" // -1 - => true, + "ADDR_NO_RANDOMIZE" | "MMAP_PAGE_ZERO" | "ADDR_COMPAT_LAYOUT" | "READ_IMPLIES_EXEC" + | "ADDR_LIMIT_32BIT" | "SHORT_INODE" | "WHOLE_SECONDS" | "STICKY_TIMEOUTS" + | "ADDR_LIMIT_3GB" => true, + + "USRQUOTA" | "GRPQUOTA" => true, - // LFS64 types have been removed in Emscripten 3.1.44+ + "Q_GETFMT" | "Q_GETINFO" | "Q_SETINFO" | "Q_SYNC" | "Q_QUOTAON" | "Q_QUOTAOFF" + | "Q_GETQUOTA" | "Q_SETQUOTA" => true, + + // FIXME: https://github.com/emscripten-core/emscripten/pull/14883 + "SIG_IGN" => true, + + // LFS64 types have been removed in Emscripten 3.1.44 // https://github.com/emscripten-core/emscripten/pull/19812 n if n.starts_with("RLIM64") => true, @@ -2920,38 +2906,19 @@ fn test_emscripten(target: &str) { cfg.skip_field_type(move |struct_, field| { // This is a weird union, don't check the type. - // FIXME: is this necessary? (struct_ == "ifaddrs" && field == "ifa_ifu") || // sighandler_t type is super weird - // FIXME: is this necessary? (struct_ == "sigaction" && field == "sa_sigaction") || // sigval is actually a union, but we pretend it's a struct - // FIXME: is this necessary? - (struct_ == "sigevent" && field == "sigev_value") || - // aio_buf is "volatile void*" and Rust doesn't understand volatile - // FIXME: is this necessary? - (struct_ == "aiocb" && field == "aio_buf") + (struct_ == "sigevent" && field == "sigev_value") }); cfg.skip_field(move |struct_, field| { // this is actually a union on linux, so we can't represent it well and // just insert some padding. - // FIXME: is this necessary? (struct_ == "siginfo_t" && field == "_pad") || // musl names this __dummy1 but it's still there - // FIXME: is this necessary? (struct_ == "glob_t" && field == "gl_flags") || - // musl seems to define this as an *anonymous* bitfield - // FIXME: is this necessary? - (struct_ == "statvfs" && field == "__f_unused") || - // sigev_notify_thread_id is actually part of a sigev_un union - (struct_ == "sigevent" && field == "sigev_notify_thread_id") || - // signalfd had SIGSYS fields added in Linux 4.18, but no libc release has them yet. - (struct_ == "signalfd_siginfo" && (field == "ssi_addr_lsb" || - field == "_pad2" || - field == "ssi_syscall" || - field == "ssi_call_addr" || - field == "ssi_arch")) || // FIXME: After musl 1.1.24, it have only one field `sched_priority`, // while other fields become reserved. (struct_ == "sched_param" && [ @@ -2962,7 +2929,6 @@ fn test_emscripten(target: &str) { ].contains(&field)) }); - // FIXME: test linux like cfg.generate("../src/lib.rs", "main.rs"); } diff --git a/src/unix/linux_like/emscripten/align.rs b/src/unix/linux_like/emscripten/align.rs index b9ea3f39efdf5..26d8378a54743 100644 --- a/src/unix/linux_like/emscripten/align.rs +++ b/src/unix/linux_like/emscripten/align.rs @@ -37,10 +37,12 @@ macro_rules! expand_align { size: [u8; ::__SIZEOF_PTHREAD_COND_T], } + // Lowered from 16 to 8 bytes in + // https://github.com/llvm/llvm-project/commit/d1a96e906cc03a95cfd41a1f22bdda92651250c7 #[allow(missing_debug_implementations)] - #[repr(align(16))] + #[repr(align(8))] pub struct max_align_t { - priv_: [f64; 4] + priv_: [f64; 3] } } diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index c492f49f2995d..acf5031396764 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -16,7 +16,11 @@ pub type loff_t = i64; pub type pthread_key_t = ::c_uint; pub type clock_t = c_long; -pub type time_t = c_long; + +// 64-bit time_t since v3.1.16 (2022/07/15) +// https://github.com/emscripten-core/emscripten/pull/17401 +pub type time_t = i64; + pub type suseconds_t = c_long; pub type ino_t = u64; pub type off_t = i64; @@ -103,7 +107,9 @@ s! { __f_spare: [::c_int; 6], } - pub struct dqblk { + // No quota.h + // https://github.com/emscripten-core/emscripten/pull/17704 + /*pub struct dqblk { pub dqb_bhardlimit: u64, pub dqb_bsoftlimit: u64, pub dqb_curspace: u64, @@ -113,7 +119,7 @@ s! { pub dqb_btime: u64, pub dqb_itime: u64, pub dqb_valid: u32, - } + }*/ pub struct signalfd_siginfo { pub ssi_signo: u32, @@ -171,7 +177,9 @@ s! { pub sem_flg: ::c_short, } - pub struct aiocb { + // No aio.h + // https://github.com/emscripten-core/emscripten/pull/18058 + /*pub struct aiocb { pub aio_fildes: ::c_int, pub aio_lio_opcode: ::c_int, pub aio_reqprio: ::c_int, @@ -186,7 +194,7 @@ s! { __next: *mut ::c_void, __prev: *mut ::c_void, __dummy4: [::c_char; 24], - } + }*/ pub struct sigaction { pub sa_sigaction: ::sighandler_t, @@ -255,17 +263,11 @@ s! { } pub struct stat { pub st_dev: ::dev_t, - #[cfg(not(emscripten_new_stat_abi))] - __st_dev_padding: ::c_int, - #[cfg(not(emscripten_new_stat_abi))] - __st_ino_truncated: ::c_long, pub st_mode: ::mode_t, pub st_nlink: ::nlink_t, pub st_uid: ::uid_t, pub st_gid: ::gid_t, pub st_rdev: ::dev_t, - #[cfg(not(emscripten_new_stat_abi))] - __st_rdev_padding: ::c_int, pub st_size: ::off_t, pub st_blksize: ::blksize_t, pub st_blocks: ::blkcnt_t, @@ -288,11 +290,8 @@ s! { pub shm_perm: ::ipc_perm, pub shm_segsz: ::size_t, pub shm_atime: ::time_t, - __unused1: ::c_int, pub shm_dtime: ::time_t, - __unused2: ::c_int, pub shm_ctime: ::time_t, - __unused3: ::c_int, pub shm_cpid: ::pid_t, pub shm_lpid: ::pid_t, pub shm_nattch: ::c_ulong, @@ -303,11 +302,8 @@ s! { pub struct msqid_ds { pub msg_perm: ::ipc_perm, pub msg_stime: ::time_t, - __unused1: ::c_int, pub msg_rtime: ::time_t, - __unused2: ::c_int, pub msg_ctime: ::time_t, - __unused3: ::c_int, __msg_cbytes: ::c_ulong, pub msg_qnum: ::msgqnum_t, pub msg_qbytes: ::msglen_t, @@ -777,9 +773,9 @@ pub const POSIX_MADV_WILLNEED: ::c_int = 3; pub const AT_EACCESS: ::c_int = 0x200; -pub const S_IEXEC: mode_t = 0o0100; -pub const S_IWRITE: mode_t = 0o0200; -pub const S_IREAD: mode_t = 0o0400; +pub const S_IEXEC: mode_t = 64; +pub const S_IWRITE: mode_t = 128; +pub const S_IREAD: mode_t = 256; pub const F_LOCK: ::c_int = 1; pub const F_TEST: ::c_int = 3; @@ -867,22 +863,28 @@ pub const SHM_UNLOCK: ::c_int = 12; pub const SHM_HUGETLB: ::c_int = 0o4000; pub const SHM_NORESERVE: ::c_int = 0o10000; -pub const QFMT_VFS_OLD: ::c_int = 1; -pub const QFMT_VFS_V0: ::c_int = 2; +// No quota.h +// https://github.com/emscripten-core/emscripten/pull/17704 +/*pub const QFMT_VFS_OLD: ::c_int = 1; +pub const QFMT_VFS_V0: ::c_int = 2;*/ -pub const EFD_SEMAPHORE: ::c_int = 0x1; +// No epoll support +// https://github.com/emscripten-core/emscripten/issues/5033 +// pub const EFD_SEMAPHORE: ::c_int = 0x1; pub const LOG_NFACILITIES: ::c_int = 24; pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t; -pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32; +// No reboot.h +// https://github.com/emscripten-core/emscripten/pull/17704 +/*pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32; pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32; pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32; pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32; pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32; pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32; -pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32; +pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;*/ pub const AI_PASSIVE: ::c_int = 0x0001; pub const AI_CANONNAME: ::c_int = 0x0002; @@ -915,19 +917,23 @@ pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4; pub const EAI_SYSTEM: ::c_int = -11; -pub const AIO_CANCELED: ::c_int = 0; +// No aio.h +// https://github.com/emscripten-core/emscripten/pull/18058 +/*pub const AIO_CANCELED: ::c_int = 0; pub const AIO_NOTCANCELED: ::c_int = 1; pub const AIO_ALLDONE: ::c_int = 2; pub const LIO_READ: ::c_int = 0; pub const LIO_WRITE: ::c_int = 1; pub const LIO_NOP: ::c_int = 2; pub const LIO_WAIT: ::c_int = 0; -pub const LIO_NOWAIT: ::c_int = 1; +pub const LIO_NOWAIT: ::c_int = 1;*/ pub const MREMAP_MAYMOVE: ::c_int = 1; pub const MREMAP_FIXED: ::c_int = 2; -pub const PR_SET_PDEATHSIG: ::c_int = 1; +// No prctrl.h +// https://github.com/emscripten-core/emscripten/pull/17704 +/*pub const PR_SET_PDEATHSIG: ::c_int = 1; pub const PR_GET_PDEATHSIG: ::c_int = 2; pub const PR_GET_DUMPABLE: ::c_int = 3; @@ -1046,7 +1052,7 @@ pub const PR_CAP_AMBIENT: ::c_int = 47; pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1; pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2; pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3; -pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4; +pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;*/ pub const ITIMER_REAL: ::c_int = 0; pub const ITIMER_VIRTUAL: ::c_int = 1; @@ -1057,10 +1063,9 @@ pub const _POSIX_VDISABLE: ::cc_t = 0; pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01; pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02; -// On Linux, libc doesn't define this constant, libattr does instead. -// We still define it for Linux as it's defined by libc on other platforms, -// and it's mentioned in the man pages for getxattr and setxattr. -pub const SFD_CLOEXEC: ::c_int = 0x080000; +// No epoll support +// https://github.com/emscripten-core/emscripten/issues/5033 +//pub const SFD_CLOEXEC: ::c_int = 0x080000; pub const NCCS: usize = 32; @@ -1210,9 +1215,11 @@ pub const SA_RESETHAND: ::c_int = 0x80000000; pub const SA_RESTART: ::c_int = 0x10000000; pub const SA_NOCLDSTOP: ::c_int = 0x00000001; -pub const EPOLL_CLOEXEC: ::c_int = 0x80000; +// No epoll support +// https://github.com/emscripten-core/emscripten/issues/5033 +/*pub const EPOLL_CLOEXEC: ::c_int = 0x80000; -pub const EFD_CLOEXEC: ::c_int = 0x80000; +pub const EFD_CLOEXEC: ::c_int = 0x80000;*/ pub const BUFSIZ: ::c_uint = 1024; pub const TMP_MAX: ::c_uint = 10000; @@ -1227,11 +1234,11 @@ pub const PTHREAD_STACK_MIN: ::size_t = 2048; pub const POSIX_FADV_DONTNEED: ::c_int = 4; pub const POSIX_FADV_NOREUSE: ::c_int = 5; -pub const POSIX_MADV_DONTNEED: ::c_int = 0; +pub const POSIX_MADV_DONTNEED: ::c_int = 4; pub const RLIM_INFINITY: ::rlim_t = !0; #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] -pub const RLIMIT_NLIMITS: ::c_int = 15; +pub const RLIMIT_NLIMITS: ::c_int = 16; #[allow(deprecated)] #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS; @@ -1246,11 +1253,15 @@ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; -pub const CPU_SETSIZE: ::c_int = 128; +pub const CPU_SETSIZE: ::c_int = 1024; -pub const QFMT_VFS_V1: ::c_int = 4; +// No quota.h +// https://github.com/emscripten-core/emscripten/pull/17704 +//pub const QFMT_VFS_V1: ::c_int = 4; -pub const PTRACE_TRACEME: ::c_int = 0; +// No ptrace.h +// https://github.com/emscripten-core/emscripten/pull/17704 +/*pub const PTRACE_TRACEME: ::c_int = 0; pub const PTRACE_PEEKTEXT: ::c_int = 1; pub const PTRACE_PEEKDATA: ::c_int = 2; pub const PTRACE_PEEKUSER: ::c_int = 3; @@ -1279,11 +1290,13 @@ pub const PTRACE_SETFPREGS: ::c_uint = 15; pub const PTRACE_GETFPXREGS: ::c_uint = 18; pub const PTRACE_SETFPXREGS: ::c_uint = 19; pub const PTRACE_GETREGS: ::c_uint = 12; -pub const PTRACE_SETREGS: ::c_uint = 13; +pub const PTRACE_SETREGS: ::c_uint = 13;*/ -pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK; +// No epoll support +// https://github.com/emscripten-core/emscripten/issues/5033 +/*pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK; -pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK; +pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;*/ pub const TCSANOW: ::c_int = 0; pub const TCSADRAIN: ::c_int = 1; @@ -1385,14 +1398,14 @@ pub const B3500000: ::speed_t = 0o010016; pub const B4000000: ::speed_t = 0o010017; pub const SO_BINDTODEVICE: ::c_int = 25; -pub const SO_TIMESTAMP: ::c_int = 29; +pub const SO_TIMESTAMP: ::c_int = 63; pub const SO_MARK: ::c_int = 36; pub const SO_RXQ_OVFL: ::c_int = 40; pub const SO_PEEK_OFF: ::c_int = 42; pub const SO_BUSY_POLL: ::c_int = 46; pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; -pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 28; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; pub const O_DIRECT: ::c_int = 0x4000; pub const O_DIRECTORY: ::c_int = 0x10000; @@ -1443,7 +1456,7 @@ pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; pub const SOCK_SEQPACKET: ::c_int = 5; -pub const IPPROTO_MAX: ::c_int = 256; +pub const IPPROTO_MAX: ::c_int = 263; pub const SOL_SOCKET: ::c_int = 1; @@ -1460,8 +1473,8 @@ pub const SO_LINGER: ::c_int = 13; pub const SO_REUSEPORT: ::c_int = 15; pub const SO_RCVLOWAT: ::c_int = 18; pub const SO_SNDLOWAT: ::c_int = 19; -pub const SO_RCVTIMEO: ::c_int = 20; -pub const SO_SNDTIMEO: ::c_int = 21; +pub const SO_RCVTIMEO: ::c_int = 66; +pub const SO_SNDTIMEO: ::c_int = 67; pub const SO_ACCEPTCONN: ::c_int = 30; pub const IPV6_RTHDR_LOOSE: ::c_int = 0; @@ -1563,7 +1576,7 @@ pub const TIOCM_RNG: ::c_int = 0x080; pub const TIOCM_DSR: ::c_int = 0x100; pub const TIOCM_CD: ::c_int = TIOCM_CAR; pub const TIOCM_RI: ::c_int = TIOCM_RNG; -pub const O_TMPFILE: ::c_int = 0x400000; +pub const O_TMPFILE: ::c_int = 0x410000; pub const MAX_ADDR_LEN: usize = 7; pub const ARPD_UPDATE: ::c_ushort = 0x01;