Skip to content

Commit 9285f0e

Browse files
0323pintgross35
authored andcommitted
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. (backport <#3927>) (cherry picked from commit 8ff67c1)
1 parent c49fe92 commit 9285f0e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libc-test/semver/netbsd.txt

Lines changed: 3 additions & 0 deletions
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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,8 @@ pub const MNT_NOWAIT: ::c_int = 2;
18861886
pub const MNT_LAZY: ::c_int = 3;
18871887

18881888
//<sys/timex.h>
1889+
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
1890+
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
18891891
pub const NTP_API: ::c_int = 4;
18901892
pub const MAXPHASE: ::c_long = 500000000;
18911893
pub const MAXFREQ: ::c_long = 500000;
@@ -2668,6 +2670,11 @@ extern "C" {
26682670
newp: *const ::c_void,
26692671
newlen: ::size_t,
26702672
) -> ::c_int;
2673+
pub fn sysctlnametomib(
2674+
sname: *const ::c_char,
2675+
name: *mut ::c_int,
2676+
namelenp: *mut ::size_t,
2677+
) -> ::c_int;
26712678
#[link_name = "__kevent50"]
26722679
pub fn kevent(
26732680
kq: ::c_int,

0 commit comments

Comments
 (0)