Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netbsd add uucred struct #2523

Merged
merged 1 commit into from Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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