Skip to content

Commit

Permalink
Auto merge of #491 - Roguelazer:add_getpeereid_function, r=alexcrichton
Browse files Browse the repository at this point in the history
Add getpeereid function

This is a wrapper around getsockopt() for getting the uid/gid of a remote Unix domain socket peer. It was added in FreeBSD 4.6 and present in all modern BSDs I checked (including Mac OS X).
  • Loading branch information
bors committed Jan 6, 2017
2 parents c900083 + 4e6dd24 commit 89c6c6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/unix/bsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ extern {
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);

pub fn getpeereid(socket: ::c_int,
euid: *mut ::uid_t,
egid: *mut ::gid_t) -> ::c_int;
}

cfg_if! {
Expand Down

0 comments on commit 89c6c6c

Please sign in to comment.