Skip to content

Commit bac1442

Browse files
committed
Auto merge of #3146 - lcheylus:openbsd, r=JohnTitor
Add OpenBSD CLOCK_* constants To compile [`wasmer-wasi`](https://github.com/wasmerio/wasmer/tree/master/lib/wasi) crate (part of Wasmer) on OpenBSD, I need to add CLOCK_* constants from `/usr/include/sys_time.h` file. - Add CLOCK_* constants in `src/unix/bsd/netbsdlike/openbsd/mod.rs` - Update `libc-test/semver/openbsd.txt` accordingly cc `@semarie`
2 parents 60bf6d7 + e71a4c0 commit bac1442

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libc-test/semver/openbsd.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ CLD_EXITED
9898
CLD_KILLED
9999
CLD_STOPPED
100100
CLD_TRAPPED
101+
CLOCK_BOOTTIME
102+
CLOCK_PROCESS_CPUTIME_ID
103+
CLOCK_THREAD_CPUTIME_ID
104+
CLOCK_UPTIME
101105
CMSG_DATA
102106
CMSG_FIRSTHDR
103107
CMSG_LEN

src/unix/bsd/netbsdlike/openbsd/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,12 @@ pub const MNT_WAIT: ::c_int = 1;
16601660
pub const MNT_NOWAIT: ::c_int = 2;
16611661
pub const MNT_LAZY: ::c_int = 3;
16621662

1663+
// sys/_time.h
1664+
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
1665+
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
1666+
pub const CLOCK_UPTIME: ::clockid_t = 5;
1667+
pub const CLOCK_BOOTTIME: ::clockid_t = 6;
1668+
16631669
pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
16641670
pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
16651671
pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;

0 commit comments

Comments
 (0)