diff options
author | DC <devnexen@gmail.com> | 2021-08-04 22:37:02 +0100 |
---|---|---|
committer | David Carlier <devnexen@gmail.com> | 2021-08-04 22:59:33 +0100 |
commit | 64271cc7d7b1a652a7ea750cc0aee608a50b6c72 (patch) | |
tree | bb7e436487bc26a63bbcc7bf30751f580e738eb5 | |
parent | 80b26105e2b89cccbba048fc26ab487ecd44616b (diff) | |
download | rust-libc-64271cc7d7b1a652a7ea750cc0aee608a50b6c72.tar.gz |
adding LOCAL_CREDS_PERSISTENT for FreeBSD.
-rw-r--r-- | src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs index b150e04d54..7ed995e33c 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs @@ -26,6 +26,17 @@ s! { pub udata: *mut ::c_void, pub ext: [u64; 4], } + + pub struct sockcred2 { + pub sc_version: ::c_int, + pub sc_pid: ::pid_t, + 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! { @@ -208,6 +219,20 @@ pub const EINTEGRITY: ::c_int = 97; pub const ELAST: ::c_int = 97; pub const GRND_INSECURE: ::c_uint = 0x4; +pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3; +pub const SCM_CREDS2: ::c_int = 0x08; + +f! { + pub fn SOCKCRED2SIZE(ngrps: usize) -> usize { + let ngrps = if ngrps > 0 { + ngrps - 1 + } else { + 0 + }; + ::mem::size_of::<sockcred2>() + ::mem::size_of::<::gid_t>() * ngrps + } +} + extern "C" { pub fn aio_readv(aiocbp: *mut ::aiocb) -> ::c_int; pub fn aio_writev(aiocbp: *mut ::aiocb) -> ::c_int; |