summaryrefslogtreecommitdiffstats
path: root/build/has
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-02-27 13:39:04 -0500
committerTavian Barnes <tavianator@tavianator.com>2025-02-27 13:39:04 -0500
commita36774be636c3429c6e73de33bf65a1bdbdcfb4b (patch)
tree525d358367a4e936dc197c94ca488a3dc822239a /build/has
parent5798978f77ef8c3efb3c99fa7fb9538c5c597024 (diff)
downloadbfs-a36774be636c3429c6e73de33bf65a1bdbdcfb4b.tar.xz
bfstd: Take sched_getaffinity() into account in nproc()
Diffstat (limited to 'build/has')
-rw-r--r--build/has/sched-getaffinity.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/build/has/sched-getaffinity.c b/build/has/sched-getaffinity.c
new file mode 100644
index 0000000..6f8fd98
--- /dev/null
+++ b/build/has/sched-getaffinity.c
@@ -0,0 +1,9 @@
+// Copyright © Tavian Barnes <tavianator@tavianator.com>
+// SPDX-License-Identifier: 0BSD
+
+#include <sched.h>
+
+int main(void) {
+ cpu_set_t set;
+ return sched_getaffinity(0, sizeof(set), &set);
+}