bytecodealliance / bytecodealliance/rustix
Peer credentials API for Mac and FreeBSD
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 294
- Avg merge
- 4h 7m
- Merged PRs (30d)
- 2
Description
Currently, the `rustix::net::sockopt::socket_peercred` is Linux-specific only. The [PR that added the API](https://github.com/bytecodealliance/rustix/pull/851), had pointers to the API used on other platforms but I didn't find any issues regarding this, so opening this issue.
I am not sure what the API would look like though? Ideally we should just make `socket_peercred` work on those platforms but `getpeereid` doesn't give you the PID. Perhaps the solution would be to just add a `#[cfg(target_os = "linux")]` to `rustix::net::UCred::pid` but then what about `rustix::net::SendAncillaryMessage::ScmCredentials`? 🤔
Contributor guide
Assessment
This issue has not been assessed yet.