Skip to content

redox: Enable getres/setres#2767

Merged
SteveLauC merged 2 commits into
nix-rust:masterfrom
willnode:redox-getsetres
May 13, 2026
Merged

redox: Enable getres/setres#2767
SteveLauC merged 2 commits into
nix-rust:masterfrom
willnode:redox-getsetres

Conversation

@willnode
Copy link
Copy Markdown
Contributor

@willnode willnode commented Apr 11, 2026

What does this PR do

This enables getset/setres unistd API for Redox OS. This has been added to libc since rust-lang/libc#4752, and tested for months by porting rustysd to the platform.

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

@SteveLauC
Copy link
Copy Markdown
Member

Let me rebase your branch to resolve the CI failures.

This comment was marked as low quality.

@SteveLauC
Copy link
Copy Markdown
Member

There 2 tests should be enabled for redox as well. Since this is a trivial change, let me do it and merge the PR.

nix/test/test_unistd.rs

Lines 724 to 740 in 759c65c

#[cfg(any(linux_android, freebsdlike, target_os = "openbsd"))]
#[test]
fn test_getresuid() {
let resuids = getresuid().unwrap();
assert_ne!(resuids.real.as_raw(), libc::uid_t::MAX);
assert_ne!(resuids.effective.as_raw(), libc::uid_t::MAX);
assert_ne!(resuids.saved.as_raw(), libc::uid_t::MAX);
}
#[cfg(any(linux_android, freebsdlike, target_os = "openbsd"))]
#[test]
fn test_getresgid() {
let resgids = getresgid().unwrap();
assert_ne!(resgids.real.as_raw(), libc::gid_t::MAX);
assert_ne!(resgids.effective.as_raw(), libc::gid_t::MAX);
assert_ne!(resgids.saved.as_raw(), libc::gid_t::MAX);
}

Copy link
Copy Markdown
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

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

Thanks!

@SteveLauC SteveLauC enabled auto-merge May 13, 2026 00:50
@SteveLauC SteveLauC added this pull request to the merge queue May 13, 2026
Merged via the queue into nix-rust:master with commit 2767914 May 13, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants