summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-15 11:30:07 +0000
committerbors <bors@rust-lang.org>2023-03-15 11:30:07 +0000
commitbac14427831aaff9b79dcdd125c03109414215c5 (patch)
treef8b83b9fd33b37da93d76fcff2de73987e26b77a
parent60bf6d7fa9d561820ea562751ee455ccf67d3015 (diff)
parente71a4c0b1fd40050f50844e2a752576bcb6b5edb (diff)
downloadrust-libc-bac14427831aaff9b79dcdd125c03109414215c5.tar.gz
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`
-rw-r--r--libc-test/semver/openbsd.txt4
-rw-r--r--src/unix/bsd/netbsdlike/openbsd/mod.rs6
2 files changed, 10 insertions, 0 deletions
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index ef1ccab2cc..bf0a838280 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -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
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 87acecb6a7..192413a54a 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -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;