Skip to content

Commit 8ff67c1

Browse files
authored
Add missing definitions on NetBSD (#3927)
This PR adds support for: CLOCK_PROCESS_CPUTIME_ID CLOCK_THREAD_CPUTIME_ID sysctlnametomib It replaces the following closed PRs: #3926 #3923 Sorry for the back and forward actions.
1 parent b23f517 commit 8ff67c1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libc-test/semver/netbsd.txt

+3
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ CLD_EXITED
136136
CLD_KILLED
137137
CLD_STOPPED
138138
CLD_TRAPPED
139+
CLOCK_PROCESS_CPUTIME_ID
140+
CLOCK_THREAD_CPUTIME_ID
139141
CMSG_DATA
140142
CMSG_FIRSTHDR
141143
CMSG_LEN
@@ -1567,6 +1569,7 @@ sync
15671569
syscall
15681570
sysctl
15691571
sysctlbyname
1572+
sysctlnametomib
15701573
sysctldesc
15711574
tcp_info
15721575
telldir

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

+7
Original file line numberDiff line numberDiff line change
@@ -1873,6 +1873,8 @@ pub const MNT_NOWAIT: ::c_int = 2;
18731873
pub const MNT_LAZY: ::c_int = 3;
18741874

18751875
//<sys/timex.h>
1876+
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
1877+
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
18761878
pub const NTP_API: ::c_int = 4;
18771879
pub const MAXPHASE: ::c_long = 500000000;
18781880
pub const MAXFREQ: ::c_long = 500000;
@@ -2646,6 +2648,11 @@ extern "C" {
26462648
newp: *const ::c_void,
26472649
newlen: ::size_t,
26482650
) -> ::c_int;
2651+
pub fn sysctlnametomib(
2652+
sname: *const ::c_char,
2653+
name: *mut ::c_int,
2654+
namelenp: *mut ::size_t,
2655+
) -> ::c_int;
26492656
#[link_name = "__kevent50"]
26502657
pub fn kevent(
26512658
kq: ::c_int,

0 commit comments

Comments
 (0)