Skip to content

Commit 4b32065

Browse files
committed
Expose functionality to get peer credentials for a Unix socket on Linux
1 parent 64da6d2 commit 4b32065

File tree

1 file changed

+7
-0
lines changed
  • src/unix/notbsd/linux/other

1 file changed

+7
-0
lines changed

Diff for: src/unix/notbsd/linux/other/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ s! {
3232
__unused4: *mut ::c_void,
3333
__unused5: *mut ::c_void,
3434
}
35+
36+
pub struct ucred {
37+
pub pid: ::pid_t,
38+
pub uid: ::uid_t,
39+
pub gid: ::gid_t,
40+
}
3541
}
3642

3743
pub const RLIMIT_RSS: ::c_int = 5;
@@ -164,6 +170,7 @@ pub const SO_KEEPALIVE: ::c_int = 9;
164170
pub const SO_OOBINLINE: ::c_int = 10;
165171
pub const SO_LINGER: ::c_int = 13;
166172
pub const SO_REUSEPORT: ::c_int = 15;
173+
pub const SO_PEERCRED: ::c_int = 17;
167174
pub const SO_RCVLOWAT: ::c_int = 18;
168175
pub const SO_SNDLOWAT: ::c_int = 19;
169176
pub const SO_RCVTIMEO: ::c_int = 20;

0 commit comments

Comments
 (0)