Skip to content

Fix DragonFly: clock_gettime() expects CLOCK_* constants as ulong. #222

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

Merged
merged 1 commit into from
Mar 11, 2016
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@ pub const RLIM_NLIMITS: ::rlim_t = 12;
pub const Q_GETQUOTA: ::c_int = 0x300;
pub const Q_SETQUOTA: ::c_int = 0x400;

pub const CLOCK_REALTIME: ::c_ulong = 0;
pub const CLOCK_VIRTUAL: ::c_ulong = 1;
pub const CLOCK_PROF: ::c_ulong = 2;
pub const CLOCK_MONOTONIC: ::c_ulong = 4;
pub const CLOCK_UPTIME: ::c_ulong = 5;
pub const CLOCK_UPTIME_PRECISE: ::c_ulong = 7;
pub const CLOCK_UPTIME_FAST: ::c_ulong = 8;
pub const CLOCK_REALTIME_PRECISE: ::c_ulong = 9;
pub const CLOCK_REALTIME_FAST: ::c_ulong = 10;
pub const CLOCK_MONOTONIC_PRECISE: ::c_ulong = 11;
pub const CLOCK_MONOTONIC_FAST: ::c_ulong = 12;
pub const CLOCK_SECOND: ::c_ulong = 13;
pub const CLOCK_THREAD_CPUTIME_ID: ::c_ulong = 14;
pub const CLOCK_PROCESS_CPUTIME_ID: ::c_ulong = 15;

extern {
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
-> ::c_int;
Expand Down
3 changes: 3 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ pub const POSIX_FADV_NOREUSE: ::c_int = 5;
pub const MADV_PROTECT: ::c_int = 10;
pub const RUSAGE_THREAD: ::c_int = 1;

pub const CLOCK_REALTIME: ::c_int = 0;
pub const CLOCK_MONOTONIC: ::c_int = 4;

extern {
pub fn __error() -> *mut ::c_int;

Expand Down
3 changes: 0 additions & 3 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,6 @@ pub const _SC_XOPEN_XCU_VERSION: ::c_int = 117;
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;

pub const CLOCK_REALTIME: ::c_int = 0;
pub const CLOCK_MONOTONIC: ::c_int = 4;

pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
pub const RLIMIT_DATA: ::c_int = 2;
Expand Down