Skip to content
Snippets Groups Projects
Commit d8764e8b authored by Greg V's avatar Greg V
Browse files

freebsd: add sockcred/SOCKCREDSIZE

Like on NetBSD, but without a pid field in the struct.
parent e687a59c
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,15 @@ s! {
pub msg_hdr: ::msghdr,
pub msg_len: ::ssize_t,
}
pub struct sockcred {
pub sc_uid: ::uid_t,
pub sc_euid: ::uid_t,
pub sc_gid: ::gid_t,
pub sc_egid: ::gid_t,
pub sc_ngroups: ::c_int,
pub sc_groups: [::gid_t; 1],
}
}
s_no_extra_traits! {
......@@ -1136,6 +1145,15 @@ f! {
as ::c_uint
}
pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
let ngrps = if ngrps > 0 {
ngrps - 1
} else {
0
};
::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
}
pub fn uname(buf: *mut ::utsname) -> ::c_int {
__xuname(256, buf as *mut ::c_void)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment