Skip to content

Commit

Permalink
Auto merge of #3146 - lcheylus:openbsd, r=JohnTitor
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
bors committed Mar 15, 2023
2 parents 60bf6d7 + e71a4c0 commit bac1442
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ CLD_EXITED
CLD_KILLED
CLD_STOPPED
CLD_TRAPPED
CLOCK_BOOTTIME
CLOCK_PROCESS_CPUTIME_ID
CLOCK_THREAD_CPUTIME_ID
CLOCK_UPTIME
CMSG_DATA
CMSG_FIRSTHDR
CMSG_LEN
Expand Down
6 changes: 6 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,12 @@ pub const MNT_WAIT: ::c_int = 1;
pub const MNT_NOWAIT: ::c_int = 2;
pub const MNT_LAZY: ::c_int = 3;

// sys/_time.h
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
pub const CLOCK_UPTIME: ::clockid_t = 5;
pub const CLOCK_BOOTTIME: ::clockid_t = 6;

pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
Expand Down

0 comments on commit bac1442

Please sign in to comment.