Skip to content

Commit c781f0b

Browse files
committed
Auto merge of #2523 - devnexen:netbsd_uucred, r=JohnTitor
netbsd add uucred struct
2 parents 84b3a7b + 69405c5 commit c781f0b

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,7 @@ fn test_netbsd(target: &str) {
10021002
"sys/times.h",
10031003
"sys/timex.h",
10041004
"sys/ucontext.h",
1005+
"sys/ucred.h",
10051006
"sys/uio.h",
10061007
"sys/un.h",
10071008
"sys/utsname.h",

libc-test/semver/netbsd.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,7 @@ utmpx
14661466
utmpxname
14671467
utpname
14681468
utrace
1469+
uucred
14691470
vm_size_t
14701471
wait4
14711472
waitid

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,14 @@ s! {
343343
pub sc_groups: [::gid_t; 1],
344344
}
345345

346+
pub struct uucred {
347+
pub cr_unused: ::c_ushort,
348+
pub cr_uid: ::uid_t,
349+
pub cr_gid: ::gid_t,
350+
pub cr_ngroups: ::c_int,
351+
pub cr_groups: [::gid_t; NGROUPS_MAX as usize],
352+
}
353+
346354
pub struct unpcbid {
347355
pub unp_pid: ::pid_t,
348356
pub unp_euid: ::uid_t,
@@ -2012,6 +2020,8 @@ pub const KVME_FLAG_PAGEABLE: ::c_int = 0x000000008;
20122020
pub const KVME_FLAG_GROWS_UP: ::c_int = 0x000000010;
20132021
pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x000000020;
20142022

2023+
pub const NGROUPS_MAX: ::c_int = 16;
2024+
20152025
const_fn! {
20162026
{const} fn _ALIGN(p: usize) -> usize {
20172027
(p + _ALIGNBYTES) & !_ALIGNBYTES

0 commit comments

Comments
 (0)