Skip to content

Commit

Permalink
Auto merge of #2523 - devnexen:netbsd_uucred, r=JohnTitor
Browse files Browse the repository at this point in the history
netbsd add uucred struct
  • Loading branch information
bors committed Nov 9, 2021
2 parents 84b3a7b + 69405c5 commit c781f0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/build.rs
Expand Up @@ -1002,6 +1002,7 @@ fn test_netbsd(target: &str) {
"sys/times.h",
"sys/timex.h",
"sys/ucontext.h",
"sys/ucred.h",
"sys/uio.h",
"sys/un.h",
"sys/utsname.h",
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/netbsd.txt
Expand Up @@ -1466,6 +1466,7 @@ utmpx
utmpxname
utpname
utrace
uucred
vm_size_t
wait4
waitid
10 changes: 10 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Expand Up @@ -343,6 +343,14 @@ s! {
pub sc_groups: [::gid_t; 1],
}

pub struct uucred {
pub cr_unused: ::c_ushort,
pub cr_uid: ::uid_t,
pub cr_gid: ::gid_t,
pub cr_ngroups: ::c_int,
pub cr_groups: [::gid_t; NGROUPS_MAX as usize],
}

pub struct unpcbid {
pub unp_pid: ::pid_t,
pub unp_euid: ::uid_t,
Expand Down Expand Up @@ -2012,6 +2020,8 @@ pub const KVME_FLAG_PAGEABLE: ::c_int = 0x000000008;
pub const KVME_FLAG_GROWS_UP: ::c_int = 0x000000010;
pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x000000020;

pub const NGROUPS_MAX: ::c_int = 16;

const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
Expand Down

0 comments on commit c781f0b

Please sign in to comment.