From f8c19f5c50cb43f9aa9bfdbd6394f5a7cc147962 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 2 Jan 2024 13:45:23 +0900 Subject: [PATCH 1/8] Prepare docs for libc v0.3 --- CONTRIBUTING.md | 7 +++++++ README.md | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d487162a5fd5d..b6f41cc6de85e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,6 +3,13 @@ Welcome! If you are reading this document, it means you are interested in contributing to the `libc` crate. +## v0.2 changes + +If you want to add your changes to v0.2, please submit them to the `libc-0.2` branch. +If you want to add any breaking changes, it should be submitted to the main branch, +which has changes for v0.3. +We will support and make a new release for v0.2 until we make the first release of v0.3. + ## Adding an API Want to use an API which currently isn't bound in `libc`? It's quite easy to add diff --git a/README.md b/README.md index 29d2a4b6160f7..395b94ce0c8f3 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,15 @@ More detailed information about the design of this library can be found in its [rfc]: https://github.com/rust-lang/rfcs/blob/HEAD/text/1291-promote-libc.md +## v0.3 Roadmap + +The main branch is now for v0.3 which has some breaking changes. + +For v0.2, please submit PRs to the `libc-0.2` branch instead. +We will stop making new v0.2 releases once we release v0.3 on crates.io. + +See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for details. + ## Usage Add the following to your `Cargo.toml`: From 552210613ff64d1f89422f09555a34f1b32f5c12 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 5 Jan 2024 15:15:47 +0100 Subject: [PATCH 2/8] Add more items from `include/linux/sched.h` header --- src/unix/linux_like/linux/mod.rs | 93 ++++++++++++++++++++++++++++---- 1 file changed, 83 insertions(+), 10 deletions(-) diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 6579fbbd0699b..acb10c603f725 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -878,6 +878,17 @@ s_no_extra_traits! { pub d_type: ::c_uchar, pub d_name: [::c_char; 256], } + + pub struct sched_attr { + pub size: ::__u32, + pub sched_policy: ::__u32, + pub sched_flags: ::__u64, + pub sched_nice: ::__s32, + pub sched_priority: ::__u32, + pub sched_runtime: ::__u64, + pub sched_deadline: ::__u64, + pub sched_period: ::__u64, + } } s_no_extra_traits! { @@ -1343,6 +1354,46 @@ cfg_if! { self.rx_filter.hash(state); } } + + impl ::fmt::Debug for sched_attr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sched_attr") + .field("size", &self.size) + .field("sched_policy", &self.sched_policy) + .field("sched_flags", &self.sched_flags) + .field("sched_nice", &self.sched_nice) + .field("sched_priority", &self.sched_priority) + .field("sched_runtime", &self.sched_runtime) + .field("sched_deadline", &self.sched_deadline) + .field("sched_period", &self.sched_period) + .finish() + } + } + impl PartialEq for sched_attr { + fn eq(&self, other: &sched_attr) -> bool { + self.size == other.size && + self.sched_policy == other.sched_policy && + self.sched_flags == other.sched_flags && + self.sched_nice == other.sched_nice && + self.sched_priority == other.sched_priority && + self.sched_runtime == other.sched_runtime && + self.sched_deadline == other.sched_deadline && + self.sched_period == other.sched_period + } + } + impl Eq for sched_attr {} + impl ::hash::Hash for sched_attr { + fn hash(&self, state: &mut H) { + self.size.hash(state); + self.sched_policy.hash(state); + self.sched_flags.hash(state); + self.sched_nice.hash(state); + self.sched_priority.hash(state); + self.sched_runtime.hash(state); + self.sched_deadline.hash(state); + self.sched_period.hash(state); + } + } } } @@ -2032,16 +2083,6 @@ pub const RENAME_NOREPLACE: ::c_uint = 1; pub const RENAME_EXCHANGE: ::c_uint = 2; pub const RENAME_WHITEOUT: ::c_uint = 4; -pub const SCHED_OTHER: ::c_int = 0; -pub const SCHED_FIFO: ::c_int = 1; -pub const SCHED_RR: ::c_int = 2; -pub const SCHED_BATCH: ::c_int = 3; -pub const SCHED_IDLE: ::c_int = 5; - -pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000; - -pub const CLONE_PIDFD: ::c_int = 0x1000; - // netinet/in.h // NOTE: These are in addition to the constants defined in src/unix/mod.rs @@ -4588,6 +4629,38 @@ pub const PF_NO_SETAFFINITY: ::c_int = 0x04000000; pub const PF_MCE_EARLY: ::c_int = 0x08000000; pub const PF_MEMALLOC_PIN: ::c_int = 0x10000000; +pub const CSIGNAL: ::c_int = 0x000000ff; + +pub const SCHED_NORMAL: ::c_int = 0; +pub const SCHED_OTHER: ::c_int = 0; +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_RR: ::c_int = 2; +pub const SCHED_BATCH: ::c_int = 3; +pub const SCHED_IDLE: ::c_int = 5; +pub const SCHED_DEADLINE: ::c_int = 6; + +pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000; + +pub const CLONE_PIDFD: ::c_int = 0x1000; + +pub const SCHED_FLAG_RESET_ON_FORK: ::c_int = 0x01; +pub const SCHED_FLAG_RECLAIM: ::c_int = 0x02; +pub const SCHED_FLAG_DL_OVERRUN: ::c_int = 0x04; +pub const SCHED_FLAG_KEEP_POLICY: ::c_int = 0x08; +pub const SCHED_FLAG_KEEP_PARAMS: ::c_int = 0x10; +pub const SCHED_FLAG_UTIL_CLAMP_MIN: ::c_int = 0x20; +pub const SCHED_FLAG_UTIL_CLAMP_MAX: ::c_int = 0x40; + +pub const SCHED_FLAG_KEEP_ALL: ::c_int = SCHED_FLAG_KEEP_POLICY | SCHED_FLAG_KEEP_PARAMS; + +pub const SCHED_FLAG_UTIL_CLAMP: ::c_int = SCHED_FLAG_UTIL_CLAMP_MIN | SCHED_FLAG_UTIL_CLAMP_MAX; + +pub const SCHED_FLAG_ALL: ::c_int = SCHED_FLAG_RESET_ON_FORK + | SCHED_FLAG_RECLAIM + | SCHED_FLAG_DL_OVERRUN + | SCHED_FLAG_KEEP_ALL + | SCHED_FLAG_UTIL_CLAMP; + f! { pub fn NLA_ALIGN(len: ::c_int) -> ::c_int { return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1) From d2368e5bc9f3ba0fb6fd43d4369a7e10c21b185c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 5 Jan 2024 15:48:36 +0100 Subject: [PATCH 3/8] Ignore `sched_attr` type for linux test --- libc-test/build.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index a3dc1bc5b2e3c..1b65d65f95ec9 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3705,6 +3705,12 @@ fn test_linux(target: &str) { // https://github.com/torvalds/linux/commit/c05cd3645814724bdeb32a2b4d953b12bdea5f8c "xdp_umem_reg_v1" => true, + // Is defined in `` but if this file is included at the same time + // as ``, the `struct sched_param` is defined twice, causing the compilation to + // fail. The problem doesn't seem to be present in more recent versions of the linux + // kernel so we can drop this and test the type once this new version is used in CI. + "sched_attr" => true, + _ => false, } }); @@ -4123,6 +4129,14 @@ fn test_linux(target: &str) { | "PF_MCE_EARLY" | "PF_MEMALLOC_PIN" => true, + "SCHED_FLAG_KEEP_POLICY" + | "SCHED_FLAG_KEEP_PARAMS" + | "SCHED_FLAG_UTIL_CLAMP_MIN" + | "SCHED_FLAG_UTIL_CLAMP_MAX" + | "SCHED_FLAG_KEEP_ALL" + | "SCHED_FLAG_UTIL_CLAMP" + | "SCHED_FLAG_ALL" if musl => true, // Needs more recent linux headers. + _ => false, } }); From 38c9d431ce4bb2c663a3765329d13fd72076943a Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 6 Jan 2024 21:39:27 +0900 Subject: [PATCH 4/8] Allow dead_code on `s_paren!` --- src/psp.rs | 3 +++ src/wasi.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/src/psp.rs b/src/psp.rs index 575232dad1f88..a4ca029b6e0c1 100644 --- a/src/psp.rs +++ b/src/psp.rs @@ -1382,15 +1382,18 @@ s_paren! { pub struct SceUid(pub i32); #[repr(transparent)] + #[allow(dead_code)] pub struct SceMpeg(*mut *mut c_void); #[repr(transparent)] + #[allow(dead_code)] pub struct SceMpegStream(*mut c_void); #[repr(transparent)] pub struct Mp3Handle(pub i32); #[repr(transparent)] + #[allow(dead_code)] pub struct RegHandle(u32); } diff --git a/src/wasi.rs b/src/wasi.rs index 1a855e0e0fe77..ae490bf94d7a2 100644 --- a/src/wasi.rs +++ b/src/wasi.rs @@ -65,6 +65,7 @@ s_paren! { // in wasi-libc clockid_t is const struct __clockid* (where __clockid is an opaque struct), // but that's an implementation detail that we don't want to have to deal with #[repr(transparent)] + #[allow(dead_code)] pub struct clockid_t(*const u8); } From 22a41ed1d99e56cbd28156b819f068c2bc47aaf1 Mon Sep 17 00:00:00 2001 From: shuoer86 <129674997+shuoer86@users.noreply.github.com> Date: Sun, 7 Jan 2024 00:08:02 +0800 Subject: [PATCH 5/8] fix typo --- src/teeos/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/teeos/mod.rs b/src/teeos/mod.rs index 066f81ca55e4c..25e06ffaa3b10 100644 --- a/src/teeos/mod.rs +++ b/src/teeos/mod.rs @@ -62,7 +62,7 @@ pub struct _CLongDouble(pub u128); // long double in C means A float point value, which has 128bit length. // but some bit maybe not used, so the really length of long double could be 80(x86) or 128(power pc/IEEE) -// this is different from f128(not stable and not inculded default) in Rust, so we use u128 for FFI(Rust to C). +// this is different from f128(not stable and not included default) in Rust, so we use u128 for FFI(Rust to C). // this is unstable and will couse to memfault/data abort. pub type c_longdouble = _CLongDouble; From 44969a99e168baf928b9644027ff13e3b6e960cb Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 6 Jan 2024 09:35:51 -0700 Subject: [PATCH 6/8] Add sigsuspend to more targets: bsd, haiku, and solarish --- libc-test/semver/apple.txt | 1 + libc-test/semver/dragonfly.txt | 1 + libc-test/semver/freebsd.txt | 1 + libc-test/semver/netbsd.txt | 1 + libc-test/semver/openbsd.txt | 1 + src/unix/bsd/mod.rs | 1 + src/unix/haiku/mod.rs | 1 + src/unix/solarish/mod.rs | 1 + 8 files changed, 8 insertions(+) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index b1911e290dad4..ce9c6097bbb88 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -2216,6 +2216,7 @@ shmid_ds sigaltstack sigevent siginfo_t +sigsuspend sigwait sockaddr_ctl sockaddr_dl diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index 20e8a515d36f4..8135be3b4948d 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -1538,6 +1538,7 @@ shmget sigaltstack sigevent siginfo_t +sigsuspend sigtimedwait sigwait sigwaitinfo diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 914808b08af5e..1144c4d4c2481 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -2192,6 +2192,7 @@ shmid_ds sigaltstack sigevent siginfo_t +sigsuspend sigtimedwait sigwait sigwaitinfo diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index e36d33224aa50..353b1e7356ff5 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -1538,6 +1538,7 @@ shmid_ds sigaltstack sigevent siginfo_t +sigsuspend sigtimedwait sigwait sigwaitinfo diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index 755983539ac8f..fd4563212d60d 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -1260,6 +1260,7 @@ shmget shmid_ds sigaltstack siginfo_t +sigsuspend sigwait sockaddr_dl sockpeercred diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 1dd21c7adaeb0..9a2e6c463d36b 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -761,6 +761,7 @@ extern "C" { )] #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; pub fn sem_close(sem: *mut sem_t) -> ::c_int; pub fn getdtablesize() -> ::c_int; pub fn getgrnam_r( diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index a7d1719983c8f..e7b0f34dd371a 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -1782,6 +1782,7 @@ extern "C" { groupcount: *mut ::c_int, ) -> ::c_int; pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; pub fn sem_close(sem: *mut sem_t) -> ::c_int; pub fn getdtablesize() -> ::c_int; pub fn getgrnam_r( diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 515c0037b42d2..c68cfba3c9932 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -2952,6 +2952,7 @@ extern "C" { result: *mut *mut ::group, ) -> ::c_int; pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; pub fn sem_close(sem: *mut sem_t) -> ::c_int; pub fn getdtablesize() -> ::c_int; From 0b9596b22c59cd97409c017cc4dc0620e15bd87c Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 7 Jan 2024 03:19:21 +0900 Subject: [PATCH 7/8] Tweak libc-0.2 CI --- .github/workflows/full_ci.yml | 58 ++++++++++------------------------- 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/.github/workflows/full_ci.yml b/.github/workflows/full_ci.yml index 0357922a3d007..a83375753f8cf 100644 --- a/.github/workflows/full_ci.yml +++ b/.github/workflows/full_ci.yml @@ -2,13 +2,16 @@ name: full CI on: merge_group: - push: - branches: ['main', 'libc-0.2'] + pull_request: + branches: + - libc-0.2 + types: + - labeled jobs: docker_linux_tier1: + if: github.event.label.name == 'libc-0.2-pre-merge-ci' permissions: - actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) contents: read # to fetch code (actions/checkout) name: Docker Linux Tier1 @@ -21,9 +24,6 @@ jobs: x86_64-unknown-linux-gnu, ] steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 - name: Setup Rust toolchain run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh @@ -31,8 +31,8 @@ jobs: run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} macos: + if: github.event.label.name == 'libc-0.2-pre-merge-ci' permissions: - actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) contents: read # to fetch code (actions/checkout) name: macOS @@ -44,9 +44,6 @@ jobs: x86_64-apple-darwin, ] steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 - name: Setup Rust toolchain run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh @@ -54,8 +51,8 @@ jobs: run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} windows: + if: github.event.label.name == 'libc-0.2-pre-merge-ci' permissions: - actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) contents: read # to fetch code (actions/checkout) name: Windows @@ -77,9 +74,6 @@ jobs: ARCH: i686 - target: i686-pc-windows-msvc steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 - name: Self-update rustup run: rustup self update @@ -92,16 +86,13 @@ jobs: shell: bash style_check: + if: github.event.label.name == 'libc-0.2-pre-merge-ci' permissions: - actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) contents: read # to fetch code (actions/checkout) name: Style check runs-on: ubuntu-22.04 steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 - name: Setup Rust toolchain run: sh ./ci/install-rust.sh @@ -109,8 +100,8 @@ jobs: run: sh ci/style.sh docker_linux_tier2: + if: github.event.label.name == 'libc-0.2-pre-merge-ci' permissions: - actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) contents: read # to fetch code (actions/checkout) name: Docker Linux Tier2 @@ -150,9 +141,6 @@ jobs: # x86_64-unknown-redox, ] steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 - name: Setup Rust toolchain run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh @@ -163,7 +151,6 @@ jobs: # Because of this, only the nightly compiler can be used on these targets. docker_linux_build_std: permissions: - actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) contents: read # to fetch code (actions/checkout) if: ${{ false }} # This is currently broken @@ -178,9 +165,6 @@ jobs: armv7-unknown-linux-uclibceabihf ] steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 - name: Setup Rust toolchain run: TOOLCHAIN=nightly INSTALL_RUST_SRC=1 sh ./ci/install-rust.sh @@ -189,17 +173,14 @@ jobs: # devkitpro's pacman needs to be connected from Docker. docker_switch: + if: github.event.label.name == 'libc-0.2-pre-merge-ci' permissions: - actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) contents: read # to fetch code (actions/checkout) name: Docker Switch needs: [docker_linux_tier1, style_check] runs-on: ubuntu-22.04 steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 - name: Setup Rust toolchain run: sh ./ci/install-rust.sh @@ -207,8 +188,8 @@ jobs: run: LIBC_CI=1 sh ./ci/run-docker.sh switch build_channels_linux: + if: github.event.label.name == 'libc-0.2-pre-merge-ci' permissions: - actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) contents: read # to fetch code (actions/checkout) name: Build Channels Linux @@ -233,9 +214,6 @@ jobs: 1.30.0, ] steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 - name: Setup Rust toolchain run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh @@ -243,6 +221,7 @@ jobs: run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh build_channels_macos: + if: github.event.label.name == 'libc-0.2-pre-merge-ci' permissions: contents: read # to fetch code (actions/checkout) @@ -268,9 +247,6 @@ jobs: - { toolchain: 1.30.0, os: macos-11 } runs-on: ${{ matrix.target.os }} steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 - name: Setup Rust toolchain run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh @@ -278,6 +254,7 @@ jobs: run: LIBC_CI=1 TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh build_channels_windows: + if: github.event.label.name == 'libc-0.2-pre-merge-ci' permissions: contents: read # to fetch code (actions/checkout) @@ -305,16 +282,13 @@ jobs: shell: bash check_cfg: + if: github.event.label.name == 'libc-0.2-pre-merge-ci' permissions: - actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds) contents: read # to fetch code (actions/checkout) name: "Check #[cfg]s" runs-on: ubuntu-22.04 steps: - - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v4 - name: Setup Rust toolchain run: TOOLCHAIN=nightly sh ./ci/install-rust.sh @@ -325,7 +299,7 @@ jobs: # protection, rather than having to add each job separately. success: name: Success - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [ docker_linux_tier1, docker_linux_tier2, From 44ba265df55df13b37a3e1e2145053b68196074d Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 7 Jan 2024 07:10:43 +0000 Subject: [PATCH 8/8] fuchsia adding pthread_set/getname_np --- libc-test/semver/fuchsia.txt | 2 ++ src/fuchsia/mod.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libc-test/semver/fuchsia.txt b/libc-test/semver/fuchsia.txt index c876cc6a5b812..525b26bd62940 100644 --- a/libc-test/semver/fuchsia.txt +++ b/libc-test/semver/fuchsia.txt @@ -1377,8 +1377,10 @@ pthread_cancel pthread_condattr_getclock pthread_condattr_setclock pthread_getattr_np +pthread_getname_np pthread_kill pthread_mutex_timedlock +pthread_setname_np ptsname_r pwritev quotactl diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index 25124e6e0fcf8..4e028ff6cc45a 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -3826,6 +3826,8 @@ extern "C" { pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int; pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int; pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int; + pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int; pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; pub fn getsockopt(