summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-12-16 08:12:55 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-12-16 08:12:55 -0800
commit4920c7e88ac2dab2adfee2d1f35a3ace492b0daa (patch)
tree1424c62e6fd33bcc9ba9ce2ce4f2999090caeaea
parent64da6d22babad4003b94220a12170599ded7f239 (diff)
parent4b320654ba75d19a4583a387fe0245b25c612f5f (diff)
downloadrust-libc-4920c7e88ac2dab2adfee2d1f35a3ace492b0daa.tar.gz
Merge pull request #101 from maghoff/master
Expose functionality to get peer credentials for a Unix socket on Linux
-rw-r--r--src/unix/notbsd/linux/other/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs
index 5c22f8e079..4053b50743 100644
--- a/src/unix/notbsd/linux/other/mod.rs
+++ b/src/unix/notbsd/linux/other/mod.rs
@@ -32,6 +32,12 @@ s! {
__unused4: *mut ::c_void,
__unused5: *mut ::c_void,
}
+
+ pub struct ucred {
+ pub pid: ::pid_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ }
}
pub const RLIMIT_RSS: ::c_int = 5;
@@ -164,6 +170,7 @@ pub const SO_KEEPALIVE: ::c_int = 9;
pub const SO_OOBINLINE: ::c_int = 10;
pub const SO_LINGER: ::c_int = 13;
pub const SO_REUSEPORT: ::c_int = 15;
+pub const SO_PEERCRED: ::c_int = 17;
pub const SO_RCVLOWAT: ::c_int = 18;
pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;