Skip to content

netbsd add uucred struct #2523

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

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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