Skip to content

Commit ef979ef

Browse files
committed
Auto merge of rust-lang#222 - mneumann:dragonfly_clock_gettime, r=alexcrichton
Fix DragonFly: clock_gettime() expects CLOCK_* constants as ulong. While there add all CLOCK_ constants as found on DragonFly.
2 parents 61ae486 + 378bb73 commit ef979ef

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

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

+15
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,21 @@ pub const RLIM_NLIMITS: ::rlim_t = 12;
9696
pub const Q_GETQUOTA: ::c_int = 0x300;
9797
pub const Q_SETQUOTA: ::c_int = 0x400;
9898

99+
pub const CLOCK_REALTIME: ::c_ulong = 0;
100+
pub const CLOCK_VIRTUAL: ::c_ulong = 1;
101+
pub const CLOCK_PROF: ::c_ulong = 2;
102+
pub const CLOCK_MONOTONIC: ::c_ulong = 4;
103+
pub const CLOCK_UPTIME: ::c_ulong = 5;
104+
pub const CLOCK_UPTIME_PRECISE: ::c_ulong = 7;
105+
pub const CLOCK_UPTIME_FAST: ::c_ulong = 8;
106+
pub const CLOCK_REALTIME_PRECISE: ::c_ulong = 9;
107+
pub const CLOCK_REALTIME_FAST: ::c_ulong = 10;
108+
pub const CLOCK_MONOTONIC_PRECISE: ::c_ulong = 11;
109+
pub const CLOCK_MONOTONIC_FAST: ::c_ulong = 12;
110+
pub const CLOCK_SECOND: ::c_ulong = 13;
111+
pub const CLOCK_THREAD_CPUTIME_ID: ::c_ulong = 14;
112+
pub const CLOCK_PROCESS_CPUTIME_ID: ::c_ulong = 15;
113+
99114
extern {
100115
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
101116
-> ::c_int;

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

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ pub const POSIX_FADV_NOREUSE: ::c_int = 5;
6060
pub const MADV_PROTECT: ::c_int = 10;
6161
pub const RUSAGE_THREAD: ::c_int = 1;
6262

63+
pub const CLOCK_REALTIME: ::c_int = 0;
64+
pub const CLOCK_MONOTONIC: ::c_int = 4;
65+
6366
extern {
6467
pub fn __error() -> *mut ::c_int;
6568

src/unix/bsd/freebsdlike/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,6 @@ pub const _SC_XOPEN_XCU_VERSION: ::c_int = 117;
366366
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
367367
pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
368368

369-
pub const CLOCK_REALTIME: ::c_int = 0;
370-
pub const CLOCK_MONOTONIC: ::c_int = 4;
371-
372369
pub const RLIMIT_CPU: ::c_int = 0;
373370
pub const RLIMIT_FSIZE: ::c_int = 1;
374371
pub const RLIMIT_DATA: ::c_int = 2;

0 commit comments

Comments
 (0)