Skip to content

Conversation

obeton
Copy link

@obeton obeton commented Sep 22, 2025

What does this PR do

The AIX signature of getgrnam_r(...) differs from POSIX specification, which expects size_t (rust: usize) as the type of the cap/buflen argument, whereas AIX uses int (rust: i32). This patch casts cap inside the nix wrapper to avoid the mismatch

Example of compilation failure from cargo build output:

error[E0308]: mismatched types --> /home/XXXX/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/nix-0.28.0/src/unistd.rs:3587:60
3587 | libc::getgrnam_r(name.as_ptr(), grp, cbuf, cap, res)
| ---------------- ^^^ expected i32, found usize
| arguments to this function are incorrect
|
note: function defined here
--> /home/XXX/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/libc-0.2.175/src/unix/aix/mod.rs:2926:12

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

@obeton obeton force-pushed the rsordi-fix-getgrnam_r-aix branch 2 times, most recently from 04bdd29 to 42800fa Compare September 22, 2025 22:31
@obeton obeton force-pushed the rsordi-fix-getgrnam_r-aix branch from 42800fa to 8d0cf92 Compare September 22, 2025 22:33
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.

1 participant