Skip to content
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

clock_nanosleep for dragonflybsd, moving constants freebsd only too. #3509

Merged
merged 1 commit into from Jan 1, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions libc-test/semver/dragonfly.txt
Expand Up @@ -1263,6 +1263,7 @@ chroot
clearerr
clock_getcpuclockid
clock_getres
clock_nanosleep
clock_settime
cmsgcred
cmsghdr
Expand Down
12 changes: 5 additions & 7 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -4728,6 +4728,11 @@ pub const RB_POWERCYCLE: ::c_int = 0x400000;
pub const RB_PROBE: ::c_int = 0x10000000;
pub const RB_MULTIPLE: ::c_int = 0x20000000;

// sys/time.h
pub const CLOCK_BOOTTIME: ::clockid_t = ::CLOCK_UPTIME;
pub const CLOCK_REALTIME_COARSE: ::clockid_t = ::CLOCK_REALTIME_FAST;
pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = ::CLOCK_MONOTONIC_FAST;

// sys/timerfd.h

pub const TFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
Expand Down Expand Up @@ -5363,13 +5368,6 @@ extern "C" {
pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;

pub fn clock_getcpuclockid2(arg1: ::id_t, arg2: ::c_int, arg3: *mut clockid_t) -> ::c_int;
pub fn clock_nanosleep(
clk_id: ::clockid_t,
flags: ::c_int,
rqtp: *const ::timespec,
rmtp: *mut ::timespec,
) -> ::c_int;

pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;

pub fn shm_create_largepage(
Expand Down
10 changes: 7 additions & 3 deletions src/unix/bsd/freebsdlike/mod.rs
Expand Up @@ -824,15 +824,12 @@ pub const CLOCK_VIRTUAL: ::clockid_t = 1;
pub const CLOCK_PROF: ::clockid_t = 2;
pub const CLOCK_MONOTONIC: ::clockid_t = 4;
pub const CLOCK_UPTIME: ::clockid_t = 5;
pub const CLOCK_BOOTTIME: ::clockid_t = CLOCK_UPTIME;
pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7;
pub const CLOCK_UPTIME_FAST: ::clockid_t = 8;
pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9;
pub const CLOCK_REALTIME_FAST: ::clockid_t = 10;
pub const CLOCK_REALTIME_COARSE: ::clockid_t = CLOCK_REALTIME_FAST;
pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11;
pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12;
pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = CLOCK_MONOTONIC_FAST;
pub const CLOCK_SECOND: ::clockid_t = 13;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15;
Expand Down Expand Up @@ -1493,6 +1490,13 @@ extern "C" {
atflag: ::c_int,
) -> ::c_int;

pub fn clock_nanosleep(
clk_id: ::clockid_t,
flags: ::c_int,
rqtp: *const ::timespec,
rmtp: *mut ::timespec,
) -> ::c_int;

pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
Expand Down