diff options
author | Magnus Hoff <maghoff@gmail.com> | 2015-12-15 10:03:55 +0100 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2015-12-22 12:55:40 -0800 |
commit | 1164ea7196994f98bc2423dd4ce73939d61ca69e (patch) | |
tree | 1a4573ec3b1c450e07a31a545959c1f2c8a53e2a /src/sys/socket/mod.rs | |
parent | 1ce4eeee906c69af94805bdda22e4a4579547dd2 (diff) | |
download | nix-1164ea7196994f98bc2423dd4ce73939d61ca69e.zip |
Implement support for getsockopt of peer credentials using the Linux specific SO_PEERCRED
Diffstat (limited to 'src/sys/socket/mod.rs')
-rw-r--r-- | src/sys/socket/mod.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 4f6add4c..7eb1901a 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -6,7 +6,7 @@ use errno::Errno; use features; use fcntl::{fcntl, FD_CLOEXEC, O_NONBLOCK}; use fcntl::FcntlArg::{F_SETFD, F_SETFL}; -use libc::{c_void, c_int, socklen_t, size_t}; +use libc::{c_void, c_int, socklen_t, size_t, pid_t, uid_t, gid_t}; use std::{mem, ptr, slice}; use std::os::unix::io::RawFd; use sys::uio::IoVec; @@ -581,6 +581,14 @@ pub struct linger { pub l_linger: c_int } +#[repr(C)] +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub struct ucred { + pid: pid_t, + uid: uid_t, + gid: gid_t, +} + /* * * ===== Socket Options ===== |