summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-10 22:03:39 +0000
committerbors <bors@rust-lang.org>2022-04-10 22:03:39 +0000
commita0e4f9df3f96993ea5be4ef40da6e906f37d0762 (patch)
tree55c036360d4772b2bd3c3bdde6beb14b6b108896
parentc25369946c6dd0db4052dfeec8add37c1015236d (diff)
parentcdba825048d2ddba98870dd1236df22ff87350a9 (diff)
downloadrust-libc-a0e4f9df3f96993ea5be4ef40da6e906f37d0762.tar.gz
Auto merge of #2745 - vityafx:add-sched-constants-for-openbsd, r=Amanieu
Add SCHED constants for OpenBSD. The constants are defined for improving the user experience when calling the libc functions related to scheduling policies. Also helps with unifiying the code as all these constants are already defined for other operating systems.
-rw-r--r--libc-test/semver/openbsd.txt3
-rw-r--r--src/unix/bsd/netbsdlike/openbsd/mod.rs4
2 files changed, 7 insertions, 0 deletions
diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt
index 0fed559825..479cef344d 100644
--- a/libc-test/semver/openbsd.txt
+++ b/libc-test/semver/openbsd.txt
@@ -708,6 +708,9 @@ RTLD_SELF
RUSAGE_CHILDREN
RUSAGE_SELF
RUSAGE_THREAD
+SCHED_FIFO
+SCHED_OTHER
+SCHED_RR
SCM_RIGHTS
SCM_TIMESTAMP
SEM_FAILED
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 02b242a696..2d0ac63443 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -1165,6 +1165,10 @@ pub const _SC_NPROCESSORS_ONLN: ::c_int = 503;
pub const FD_SETSIZE: usize = 1024;
+pub const SCHED_FIFO: ::c_int = 1;
+pub const SCHED_OTHER: ::c_int = 2;
+pub const SCHED_RR: ::c_int = 3;
+
pub const ST_NOSUID: ::c_ulong = 2;
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;