Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SysV semaphore constants #4286

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

bertptrs
Copy link
Contributor

@bertptrs bertptrs commented Feb 25, 2025

Description

This patch adds missing constants required to use the SysV semaphore system, fixes #4264. Arguably, most of these constants should be c_short rather than c_int, as that is how they are used, but they already exist for other UNIXes as c_int so I opted to be consistent with those.

Sources

Definitions: https://github.com/torvalds/linux/blob/cc8a0934d099b8153fc880a3588eec4791a7bccb/include/uapi/linux/sem.h#L7-L22

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented Feb 25, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@@ -2979,6 +2979,19 @@ pub const MSG_NOERROR: c_int = 0o10000;
pub const MSG_EXCEPT: c_int = 0o20000;
pub const MSG_ZEROCOPY: c_int = 0x4000000;

pub const SEM_UNDO: c_int = 4096;
Copy link
Contributor

@tgross35 tgross35 Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change the literal to 0x1000 to match the Linux header? Please squash after, otherwise lgtm

@bertptrs bertptrs force-pushed the sysv-semaphore-constants branch from 3dacbcd to cb8c0ba Compare March 1, 2025 09:20
@bertptrs bertptrs requested a review from tgross35 March 1, 2025 09:22
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tgross35 tgross35 force-pushed the sysv-semaphore-constants branch from cb8c0ba to f84f618 Compare March 1, 2025 09:34
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Mar 2, 2025
@tgross35 tgross35 added this pull request to the merge queue Mar 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 2, 2025
@tgross35 tgross35 added this pull request to the merge queue Mar 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 3, 2025
@tgross35 tgross35 added this pull request to the merge queue Mar 3, 2025
Merged via the queue into rust-lang:main with commit e021460 Mar 3, 2025
44 checks passed
@bertptrs bertptrs deleted the sysv-semaphore-constants branch March 3, 2025 08:02
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Mar 10, 2025
(backport <rust-lang#4286>)
(cherry picked from commit f84f618)
@tgross35 tgross35 mentioned this pull request Mar 10, 2025
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Mar 10, 2025
(backport <rust-lang#4286>)
(cherry picked from commit f84f618)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Mar 10, 2025
(backport <rust-lang#4286>)
(cherry picked from commit f84f618)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Mar 10, 2025
(backport <rust-lang#4286>)
(cherry picked from commit f84f618)
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-linux O-unix S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing constants for System V semaphores
3 participants