1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Per-platform FFI surface for kernel credential extraction.
//!
//! Each `mod {linux,macos,bsd}` defines the platform's `Iovec`, `Msghdr`,
//! `Cmsghdr` / `AuditToken` / `Xucred` / `Cmsgcred`, the relevant constants
//! (`SOL_SOCKET`, `SO_PASSCRED` / `LOCAL_PEERTOKEN` / `LOCAL_CREDS`, ...),
//! the inline `extern "C"` declarations for `setsockopt` / `recvmsg` /
//! `getsockopt`, the `ANCILLARY_BUFFER_SIZE` constant, the
//! `peer_pid_after_recv` extractor, and the compile-time `offset_of!`
//! assertions that catch ABI drift on any kernel/libc combination.
//!
//! Only the active target's module is compiled; this `mod.rs` re-exports its
//! contents under the path `super::plat::*` (aliased in `peer_cred::mod.rs`)
//! so the receive path needs no further cfg gating.
pub use *;
pub use *;
// The BSD module is compiled on the actual BSD targets *and* on Linux. On
// Linux it provides pure-data types and the `unsafe impl CmsgPlatform for
// BsdCmsg` body so the cmsg miri tests can drive the BSD walker arm on a
// Linux CI host. The `extern "C"` FFI, `LOCAL_CREDS`, and `peer_pid_after_recv`
// stay gated to actual BSD targets via inner `#[cfg]` attributes.
pub
pub use *;
// The illumos module is also compiled on Linux so the Miri cmsg walker tests
// can drive the illumos-shaped buffer layout on the Linux CI host — the same
// pattern used for `mod bsd` above. FFI symbols and `use illumos::*` stay
// gated to the actual illumos/Solaris targets.
pub
pub use *;