Skip to content

Commit b27bf46

Browse files
committed
clock_nanosleep for dragonflybsd, moving constants freebsd only too.
1 parent c204453 commit b27bf46

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

libc-test/semver/dragonfly.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,7 @@ chroot
12631263
clearerr
12641264
clock_getcpuclockid
12651265
clock_getres
1266+
clock_nanosleep
12661267
clock_settime
12671268
cmsgcred
12681269
cmsghdr

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4728,6 +4728,11 @@ pub const RB_POWERCYCLE: ::c_int = 0x400000;
47284728
pub const RB_PROBE: ::c_int = 0x10000000;
47294729
pub const RB_MULTIPLE: ::c_int = 0x20000000;
47304730

4731+
// sys/time.h
4732+
pub const CLOCK_BOOTTIME: ::clockid_t = ::CLOCK_UPTIME;
4733+
pub const CLOCK_REALTIME_COARSE: ::clockid_t = ::CLOCK_REALTIME_FAST;
4734+
pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = ::CLOCK_MONOTONIC_FAST;
4735+
47314736
// sys/timerfd.h
47324737

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

53655370
pub fn clock_getcpuclockid2(arg1: ::id_t, arg2: ::c_int, arg3: *mut clockid_t) -> ::c_int;
5366-
pub fn clock_nanosleep(
5367-
clk_id: ::clockid_t,
5368-
flags: ::c_int,
5369-
rqtp: *const ::timespec,
5370-
rmtp: *mut ::timespec,
5371-
) -> ::c_int;
5372-
53735371
pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;
53745372

53755373
pub fn shm_create_largepage(

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,15 +824,12 @@ pub const CLOCK_VIRTUAL: ::clockid_t = 1;
824824
pub const CLOCK_PROF: ::clockid_t = 2;
825825
pub const CLOCK_MONOTONIC: ::clockid_t = 4;
826826
pub const CLOCK_UPTIME: ::clockid_t = 5;
827-
pub const CLOCK_BOOTTIME: ::clockid_t = CLOCK_UPTIME;
828827
pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7;
829828
pub const CLOCK_UPTIME_FAST: ::clockid_t = 8;
830829
pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9;
831830
pub const CLOCK_REALTIME_FAST: ::clockid_t = 10;
832-
pub const CLOCK_REALTIME_COARSE: ::clockid_t = CLOCK_REALTIME_FAST;
833831
pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11;
834832
pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12;
835-
pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = CLOCK_MONOTONIC_FAST;
836833
pub const CLOCK_SECOND: ::clockid_t = 13;
837834
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
838835
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15;
@@ -1493,6 +1490,13 @@ extern "C" {
14931490
atflag: ::c_int,
14941491
) -> ::c_int;
14951492

1493+
pub fn clock_nanosleep(
1494+
clk_id: ::clockid_t,
1495+
flags: ::c_int,
1496+
rqtp: *const ::timespec,
1497+
rmtp: *mut ::timespec,
1498+
) -> ::c_int;
1499+
14961500
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
14971501
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
14981502
pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;

0 commit comments

Comments
 (0)