Skip to content

Commit 89c6c6c

Browse files
committed
Auto merge of #491 - Roguelazer:add_getpeereid_function, r=alexcrichton
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).
2 parents c900083 + 4e6dd24 commit 89c6c6c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/unix/bsd/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ extern {
355355
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
356356
pub fn if_nameindex() -> *mut if_nameindex;
357357
pub fn if_freenameindex(ptr: *mut if_nameindex);
358+
359+
pub fn getpeereid(socket: ::c_int,
360+
euid: *mut ::uid_t,
361+
egid: *mut ::gid_t) -> ::c_int;
358362
}
359363

360364
cfg_if! {

0 commit comments

Comments
 (0)