Skip to content

Commit

Permalink
Add missing definitions on NetBSD
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
0323pin committed Sep 25, 2024
1 parent 2c0250f commit 4001810
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/semver/netbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ CLD_EXITED
CLD_KILLED
CLD_STOPPED
CLD_TRAPPED
CLOCK_PROCESS_CPUTIME_ID
CLOCK_THREAD_CPUTIME_ID
CMSG_DATA
CMSG_FIRSTHDR
CMSG_LEN
Expand Down Expand Up @@ -1567,6 +1569,7 @@ sync
syscall
sysctl
sysctlbyname
sysctlnametomib
sysctldesc
tcp_info
telldir
Expand Down
7 changes: 7 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,8 @@ pub const MNT_NOWAIT: ::c_int = 2;
pub const MNT_LAZY: ::c_int = 3;

//<sys/timex.h>
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
pub const NTP_API: ::c_int = 4;
pub const MAXPHASE: ::c_long = 500000000;
pub const MAXFREQ: ::c_long = 500000;
Expand Down Expand Up @@ -2646,6 +2648,11 @@ extern "C" {
newp: *const ::c_void,
newlen: ::size_t,
) -> ::c_int;
pub fn sysctlnametomib(
sname: *const ::c_char,
name: *mut ::c_int,
namelenp: *mut ::size_t,
) -> ::c_int;
#[link_name = "__kevent50"]
pub fn kevent(
kq: ::c_int,
Expand Down

0 comments on commit 4001810

Please sign in to comment.