Skip to content

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Mar 11, 2024

As suggested in #117156 (comment) — this PR contains #117156 + a change in src/ci/github-actions/ci.yml to make it run the arm-android build, which is the one that failed in #121887 (comment).

r? ghost

These methods are the pre-stabilized API for obtaining peer credentials
from an `AF_UNIX` socket, part of the `unix_socket_ancillary_data` feature.

Their current behavior is to get/set one of the `SO_PASSCRED` (Linux),
`LOCAL_CREDS_PERSISTENT` (FreeBSD), or `LOCAL_CREDS` (NetBSD) socket
options. On other targets the `{set_}passcred()` methods do not exist.

There are two problems with this approach:

1. Having public methods only exist for certain targets isn't permitted
   in a stable `std` API.

2. These options have generally similar purposes, but they are non-POSIX
   and their details can differ in subtle and surprising ways (such as
   whether they continue to be set after the next call to `recvmsg()`).

Splitting into OS-specific extension traits is the preferred solution to
both problems.
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc O-android Operating system: Android O-linux Operating system: Linux O-netbsd Operating system: NetBSD O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 11, 2024
@dtolnay dtolnay self-assigned this Mar 11, 2024
@rust-log-analyzer

This comment has been minimized.

@dtolnay dtolnay force-pushed the os-unix-socket-ext branch from 3298004 to ed48ec0 Compare March 11, 2024 04:20
@dtolnay dtolnay closed this Mar 11, 2024
@dtolnay dtolnay deleted the os-unix-socket-ext branch March 11, 2024 05:52
@dtolnay dtolnay removed A-testsuite Area: The testsuite used to check the correctness of rustc O-linux Operating system: Linux O-netbsd Operating system: NetBSD S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. O-unix Operating system: Unix-like labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-android Operating system: Android T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants