Skip to content

Commit

Permalink
Add getpeereid function
Browse files Browse the repository at this point in the history
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
Roguelazer committed Jan 6, 2017
1 parent c900083 commit 4e6dd24
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 4e6dd24

Please sign in to comment.