summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Polevoy <fx@thefx.co>2022-04-09 21:53:47 +0200
committerVictor Polevoy <fx@thefx.co>2022-04-09 21:53:47 +0200
commitcdba825048d2ddba98870dd1236df22ff87350a9 (patch)
tree3e699c44e02e11eef8abbf44cea1aeb2338c6255
parent53f78cdcd4dd306d5d51044ace8031b3f3e00756 (diff)
downloadrust-libc-cdba825048d2ddba98870dd1236df22ff87350a9.tar.gz
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 _;