diff options
-rw-r--r-- | .cirrus.yml | 2 | ||||
-rw-r--r-- | .github/workflows/bors.yml | 32 | ||||
-rw-r--r-- | ci/docker/sparc64-unknown-linux-gnu/Dockerfile | 3 | ||||
-rw-r--r-- | ci/linux-sparc64.sh | 2 | ||||
-rw-r--r-- | libc-test/Cargo.toml | 2 | ||||
-rw-r--r-- | libc-test/build.rs | 23 | ||||
-rw-r--r-- | libc-test/semver/freebsd.txt | 6 | ||||
-rw-r--r-- | libc-test/semver/linux.txt | 7 | ||||
-rw-r--r-- | libc-test/semver/netbsd.txt | 2 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/freebsd/mod.rs | 9 | ||||
-rw-r--r-- | src/unix/bsd/netbsdlike/netbsd/mod.rs | 56 | ||||
-rw-r--r-- | src/unix/haiku/mod.rs | 2 | ||||
-rw-r--r-- | src/unix/linux_like/linux/arch/generic/mod.rs | 10 | ||||
-rw-r--r-- | src/unix/linux_like/linux/arch/mips/mod.rs | 3 | ||||
-rw-r--r-- | src/unix/linux_like/linux/arch/powerpc/mod.rs | 3 | ||||
-rw-r--r-- | src/unix/linux_like/linux/gnu/mod.rs | 17 | ||||
-rw-r--r-- | src/unix/linux_like/linux/mod.rs | 2 | ||||
-rw-r--r-- | src/unix/linux_like/mod.rs | 13 | ||||
-rw-r--r-- | src/unix/redox/mod.rs | 10 |
19 files changed, 127 insertions, 77 deletions
diff --git a/.cirrus.yml b/.cirrus.yml index d9fc3c90a8..24f152846d 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -15,7 +15,7 @@ task: task: name: nightly x86_64-unknown-freebsd-13 freebsd_instance: - image_family: freebsd-13-1 + image_family: freebsd-13-2 setup_script: - pkg install -y libnghttp2 curl - curl https://sh.rustup.rs -sSf --output rustup.sh diff --git a/.github/workflows/bors.yml b/.github/workflows/bors.yml index e4e342a1b3..c295f332ae 100644 --- a/.github/workflows/bors.yml +++ b/.github/workflows/bors.yml @@ -259,36 +259,32 @@ jobs: name: Build Channels macOS needs: macos - # FIXME: Use macOS 11 for now as CI failed with a linker error on macOS 12 image: - # ld: in /.../x86_64-apple-darwin/lib/libstd-a4729905.rlib(rust.metadata.bin), - # archive member 'rust.metadata.bin' with length 2958149 is not mach-o or llvm bitcode file '/.../x86_64-apple-darwin/lib/libstd-a4729905.rlib' - # Possibly related: https://github.com/actions/runner-images/issues/6350 - runs-on: macos-11 env: OS: macos strategy: fail-fast: true max-parallel: 4 matrix: - toolchain: [ - stable, - beta, - nightly, - 1.13.0, - 1.19.0, - 1.24.0, - 1.25.0, - 1.30.0, - ] + target: + - { toolchain: stable, os: macos-12 } + - { toolchain: beta, os: macos-12 } + - { toolchain: nightly, os: macos-12 } + # Use macOS 11 for older toolchains as newer Xcode donesn't work well. + - { toolchain: 1.13.0, os: macos-11 } + - { toolchain: 1.19.0, os: macos-11 } + - { toolchain: 1.24.0, os: macos-11 } + - { toolchain: 1.25.0, os: macos-11 } + - { toolchain: 1.30.0, os: macos-11 } + runs-on: ${{ matrix.target.os }} steps: - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master with: github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v3 - name: Setup Rust toolchain - run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh + run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh - name: Execute build.sh - run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh + run: LIBC_CI=1 TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh build_channels_windows: permissions: @@ -314,7 +310,7 @@ jobs: 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 + run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh shell: bash check_cfg: diff --git a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile index d45e56195d..ff6810a7fa 100644 --- a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile @@ -1,5 +1,4 @@ -# FIXME: Update to 22.04 once Debian image of sparc64 has a newer glibc. -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates \ diff --git a/ci/linux-sparc64.sh b/ci/linux-sparc64.sh index db215cabf6..a42218a62e 100644 --- a/ci/linux-sparc64.sh +++ b/ci/linux-sparc64.sh @@ -5,7 +5,7 @@ set -ex mkdir -m 777 /qemu cd /qemu -curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/snapshots/2022-03-28/debian-11.0.0-sparc64-NETINST-1.iso +curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/snapshots/2022-12-09/debian-11.0.0-sparc64-NETINST-1.iso 7z e debian-11.0.0-sparc64-NETINST-1.iso install/initrd.gz 7z e debian-11.0.0-sparc64-NETINST-1.iso install/vmlinux mv vmlinux kernel diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index 212938b23d..83bfcba9c6 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -12,7 +12,7 @@ A test crate for the libc crate. [dependencies.libc] path = ".." -version = "0.2.122" +version = "0.2.142" default-features = false [build-dependencies] diff --git a/libc-test/build.rs b/libc-test/build.rs index ac0f996fc4..0a8b175c34 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1788,6 +1788,16 @@ fn test_android(target: &str) { // kernel 5.10 minimum required "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ" | "MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ" => true, + // kernel 5.18 minimum + | "MADV_COLD" + | "MADV_DONTNEED_LOCKED" + | "MADV_PAGEOUT" + | "MADV_POPULATE_READ" + | "MADV_POPULATE_WRITE" => true, + + // kernel 5.6 minimum required + "IPPROTO_MPTCP" => true, + _ => false, } }); @@ -2286,6 +2296,9 @@ fn test_freebsd(target: &str) { // Added in FreeBSD 14 "EV_KEEPUDATA" if Some(14) > freebsd_ver => true, + // Added in FreeBSD 13.2 + "AT_USRSTACKBASE" | "AT_USRSTACKLIM" if Some(13) > freebsd_ver => true, + _ => false, } }); @@ -3714,6 +3727,12 @@ fn test_linux(target: &str) { // Added in Linux 5.13 "PTRACE_GET_RSEQ_CONFIGURATION" if sparc64 => true, + | "MADV_COLD" + | "MADV_PAGEOUT" + | "MADV_POPULATE_READ" + | "MADV_POPULATE_WRITE" + if sparc64 || musl => true, + // FIXME: Requires more recent kernel headers | "IFLA_PARENT_DEV_NAME" // linux v5.13+ | "IFLA_PARENT_DEV_BUS_NAME" // linux v5.13+ @@ -3721,6 +3740,7 @@ fn test_linux(target: &str) { | "IFLA_TSO_MAX_SIZE" // linux v5.18+ | "IFLA_TSO_MAX_SEGS" // linux v5.18+ | "IFLA_ALLMULTI" // linux v6.0+ + | "MADV_DONTNEED_LOCKED" // linux v5.18+ => true, "SCTP_FUTURE_ASSOC" | "SCTP_CURRENT_ASSOC" | "SCTP_ALL_ASSOC" | "SCTP_PEER_ADDR_THLDS_V2" => true, // linux 5.5+ @@ -3761,9 +3781,6 @@ fn test_linux(target: &str) { // https://github.com/gnzlbg/ctest/issues/68 "lio_listio" if musl => true, - // FIXME: the glibc version used by the Sparc64 build jobs - // which use Debian 10.0 is too old. - "statx" if sparc64 => true, // Needs glibc 2.34 or later. "posix_spawn_file_actions_addclosefrom_np" if gnu && sparc64 => true, // Needs glibc 2.35 or later. diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 5776e8a421..ed9aceecbd 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -84,6 +84,7 @@ ATF_PERM ATF_PUBL ATF_USETRAILERS AT_BASE +AT_CANARY AT_EACCESS AT_EGID AT_EMPTY_PATH @@ -93,8 +94,13 @@ AT_EXECPATH AT_FDCWD AT_FLAGS AT_GID +AT_HWCAP +AT_HWCAP2 +AT_NCPUS AT_NOTELF AT_NULL +AT_OSRELDATE +AT_PAGESIZES AT_PAGESZ AT_PHDR AT_PHENT diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 27bd9accc2..4e9ff8d420 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -1286,22 +1286,29 @@ LOG_FTP LOG_NFACILITIES LOG_PERROR L_tmpnam +MADV_COLD MADV_DODUMP MADV_DOFORK MADV_DONTDUMP MADV_DONTFORK MADV_DONTNEED +MADV_DONTNEED_LOCKED MADV_FREE MADV_HUGEPAGE MADV_HWPOISON +MADV_KEEPONFORK MADV_MERGEABLE MADV_NOHUGEPAGE MADV_NORMAL +MADV_PAGEOUT +MADV_POPULATE_READ +MADV_POPULATE_WRITE MADV_RANDOM MADV_REMOVE MADV_SEQUENTIAL MADV_UNMERGEABLE MADV_WILLNEED +MADV_WIPEONFORK MAP_DENYWRITE MAP_EXECUTABLE MAP_FILE diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index 1ae531f55a..6dd75bde86 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -1567,3 +1567,5 @@ EXTATTR_NAMESPACE_EMPTY extattr_list_fd extattr_list_file extattr_list_link +EOWNERDEAD +ENOTRECOVERABLE diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 2ee676d973..01a3bf9db8 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -3767,6 +3767,15 @@ pub const AT_EUID: ::c_int = 12; pub const AT_GID: ::c_int = 13; pub const AT_EGID: ::c_int = 14; pub const AT_EXECPATH: ::c_int = 15; +pub const AT_CANARY: ::c_int = 16; +pub const AT_OSRELDATE: ::c_int = 18; +pub const AT_NCPUS: ::c_int = 19; +pub const AT_PAGESIZES: ::c_int = 20; +pub const AT_TIMEKEEP: ::c_int = 22; +pub const AT_HWCAP: ::c_int = 25; +pub const AT_HWCAP2: ::c_int = 26; +pub const AT_USRSTACKBASE: ::c_int = 35; +pub const AT_USRSTACKLIM: ::c_int = 36; pub const TABDLY: ::tcflag_t = 0x00000004; pub const TAB0: ::tcflag_t = 0x00000000; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 402257fd3b..210a2a392a 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1464,7 +1464,15 @@ pub const ENOATTR: ::c_int = 93; pub const EMULTIHOP: ::c_int = 94; pub const ENOLINK: ::c_int = 95; pub const EPROTO: ::c_int = 96; -pub const ELAST: ::c_int = 96; +pub const EOWNERDEAD: ::c_int = 97; +pub const ENOTRECOVERABLE: ::c_int = 98; +#[deprecated( + since = "0.2.143", + note = "This value will always match the highest defined error number \ + and thus is not stable. \ + See #3040 for more info." +)] +pub const ELAST: ::c_int = 98; pub const F_DUPFD_CLOEXEC: ::c_int = 12; pub const F_CLOSEM: ::c_int = 10; @@ -2505,31 +2513,7 @@ extern "C" { ) -> ::c_int; pub fn reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int; -} - -#[link(name = "rt")] -extern "C" { - pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; - pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; - pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; - pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; - pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; - #[link_name = "__aio_suspend50"] - pub fn aio_suspend( - aiocb_list: *const *const aiocb, - nitems: ::c_int, - timeout: *const ::timespec, - ) -> ::c_int; - pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; - pub fn lio_listio( - mode: ::c_int, - aiocb_list: *const *mut aiocb, - nitems: ::c_int, - sevp: *mut sigevent, - ) -> ::c_int; -} -extern "C" { pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int; pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; @@ -2959,6 +2943,28 @@ extern "C" { pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; } +#[link(name = "rt")] +extern "C" { + pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; + pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; + #[link_name = "__aio_suspend50"] + pub fn aio_suspend( + aiocb_list: *const *const aiocb, + nitems: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn lio_listio( + mode: ::c_int, + aiocb_list: *const *mut aiocb, + nitems: ::c_int, + sevp: *mut sigevent, + ) -> ::c_int; +} + #[link(name = "util")] extern "C" { #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")] diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index 2fa3327834..c1a38f1b36 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -2055,7 +2055,7 @@ extern "C" { ) -> ::c_int; } -#[link(name = "unix")] +#[link(name = "gnu")] extern "C" { pub fn memmem( source: *const ::c_void, diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs index 4693978311..8acf5b5520 100644 --- a/src/unix/linux_like/linux/arch/generic/mod.rs +++ b/src/unix/linux_like/linux/arch/generic/mod.rs @@ -104,6 +104,8 @@ cfg_if! { pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68; } } +// pub const SO_PREFER_BUSY_POLL: ::c_int = 69; +// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; cfg_if! { if #[cfg(any(target_arch = "x86", @@ -114,16 +116,8 @@ cfg_if! { target_arch = "s390x"))] { pub const FICLONE: ::c_ulong = 0x40049409; pub const FICLONERANGE: ::c_ulong = 0x4020940D; - } else if #[cfg(any(target_arch = "mips", - target_arch = "mips64", - target_arch = "powerpc", - target_arch = "powerpc64"))] { - pub const FICLONE: ::c_ulong = 0x80049409; - pub const FICLONERANGE: ::c_ulong = 0x8020940D; } } -// pub const SO_PREFER_BUSY_POLL: ::c_int = 69; -// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; // Defined in unix/linux_like/mod.rs // pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; diff --git a/src/unix/linux_like/linux/arch/mips/mod.rs b/src/unix/linux_like/linux/arch/mips/mod.rs index 077417de52..34c00a2936 100644 --- a/src/unix/linux_like/linux/arch/mips/mod.rs +++ b/src/unix/linux_like/linux/arch/mips/mod.rs @@ -103,6 +103,9 @@ pub const SO_TIMESTAMPING: ::c_int = 37; // pub const SO_PREFER_BUSY_POLL: ::c_int = 69; // pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; +pub const FICLONE: ::c_ulong = 0x80049409; +pub const FICLONERANGE: ::c_ulong = 0x8020940D; + // Defined in unix/linux_like/mod.rs // pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; diff --git a/src/unix/linux_like/linux/arch/powerpc/mod.rs b/src/unix/linux_like/linux/arch/powerpc/mod.rs index 637b7a1e34..64c3eaab54 100644 --- a/src/unix/linux_like/linux/arch/powerpc/mod.rs +++ b/src/unix/linux_like/linux/arch/powerpc/mod.rs @@ -85,6 +85,9 @@ pub const SO_BINDTOIFINDEX: ::c_int = 62; // pub const SO_PREFER_BUSY_POLL: ::c_int = 69; // pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; +pub const FICLONE: ::c_ulong = 0x80049409; +pub const FICLONERANGE: ::c_ulong = 0x8020940D; + // Defined in unix/linux_like/mod.rs // pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index 1aad8361ad..e88ad4eb2c 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -1240,9 +1240,6 @@ extern "C" { pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char; -} - -extern "C" { pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; pub fn glob64( @@ -1331,9 +1328,6 @@ extern "C" { /// GNU version of `basename(3)`, defined in `string.h`. #[link_name = "basename"] pub fn gnu_basename(path: *const ::c_char) -> *mut ::c_char; -} - -extern "C" { pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void; pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int; pub fn dladdr1( @@ -1343,15 +1337,10 @@ extern "C" { flags: ::c_int, ) -> ::c_int; pub fn malloc_trim(__pad: ::size_t) -> ::c_int; -} - -extern "C" { pub fn gnu_get_libc_release() -> *const ::c_char; pub fn gnu_get_libc_version() -> *const ::c_char; -} -// posix/spawn.h -extern "C" { + // posix/spawn.h // Added in `glibc` 2.29 pub fn posix_spawn_file_actions_addchdir_np( actions: *mut ::posix_spawn_file_actions_t, @@ -1372,10 +1361,8 @@ extern "C" { actions: *mut ::posix_spawn_file_actions_t, tcfd: ::c_int, ) -> ::c_int; -} -// mntent.h -extern "C" { + // mntent.h pub fn getmntent_r( stream: *mut ::FILE, mntbuf: *mut ::mntent, diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index a982901113..dae589fd14 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1933,8 +1933,6 @@ pub const CLONE_PIDFD: ::c_int = 0x1000; // netinet/in.h // NOTE: These are in addition to the constants defined in src/unix/mod.rs -/// Multipath TCP -pub const IPPROTO_MPTCP: ::c_int = 262; #[deprecated( since = "0.2.80", note = "This value was increased in the newer kernel \ diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 584e308ce2..e08bb7dbb0 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -662,7 +662,18 @@ pub const MADV_HUGEPAGE: ::c_int = 14; pub const MADV_NOHUGEPAGE: ::c_int = 15; pub const MADV_DONTDUMP: ::c_int = 16; pub const MADV_DODUMP: ::c_int = 17; +pub const MADV_WIPEONFORK: ::c_int = 18; +pub const MADV_KEEPONFORK: ::c_int = 19; +pub const MADV_COLD: ::c_int = 20; +pub const MADV_PAGEOUT: ::c_int = 21; pub const MADV_HWPOISON: ::c_int = 100; +cfg_if! { + if #[cfg(not(target_os = "emscripten"))] { + pub const MADV_POPULATE_READ: ::c_int = 22; + pub const MADV_POPULATE_WRITE: ::c_int = 23; + pub const MADV_DONTNEED_LOCKED: ::c_int = 24; + } +} pub const IFF_UP: ::c_int = 0x1; pub const IFF_BROADCAST: ::c_int = 0x2; @@ -905,6 +916,8 @@ pub const IPPROTO_UDPLITE: ::c_int = 136; pub const IPPROTO_RAW: ::c_int = 255; pub const IPPROTO_BEETPH: ::c_int = 94; pub const IPPROTO_MPLS: ::c_int = 137; +/// Multipath TCP +pub const IPPROTO_MPTCP: ::c_int = 262; pub const MCAST_EXCLUDE: ::c_int = 0; pub const MCAST_INCLUDE: ::c_int = 1; diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index dec47c610b..ccd3d779fa 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -47,6 +47,7 @@ pub type speed_t = u32; pub type suseconds_t = ::c_int; pub type tcflag_t = u32; pub type time_t = ::c_longlong; +pub type id_t = ::c_uint; #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} @@ -1104,6 +1105,15 @@ extern "C" { // strings.h pub fn explicit_bzero(p: *mut ::c_void, len: ::size_t); + + pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; + pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; + + pub fn getsubopt( + optionp: *mut *mut c_char, + tokens: *const *mut c_char, + valuep: *mut *mut c_char, + ) -> ::c_int; } cfg_if! { |