From cdba825048d2ddba98870dd1236df22ff87350a9 Mon Sep 17 00:00:00 2001 From: Victor Polevoy Date: Sat, 9 Apr 2022 21:53:47 +0200 Subject: [PATCH] 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. --- libc-test/semver/openbsd.txt | 3 +++ src/unix/bsd/netbsdlike/openbsd/mod.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index 0fed5598..479cef34 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 02b242a6..2d0ac634 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 _;