1 ! Copyright (C) 2022 Cat Stevens.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types alien.syntax kernel sequences ;
6 ! Note: Feature "_POSIX_PRIORITY_SCHEDULING"
7 ! Scheduling policy values from <sched.h>
8 CONSTANT: SCHED_OTHER 0
12 ! Note: Feature "__USE_GNU"
13 CONSTANT: SCHED_BATCH 3
15 CONSTANT: SCHED_IDLE 5
16 CONSTANT: SCHED_DEADLINE 6
18 CONSTANT: SCHED_RESET_ON_FORK 0x40000000
21 CONSTANT: MOST_IDLE_SCHED_POLICY 5
23 FUNCTION: int sched_get_priority_min ( int policy )
24 FUNCTION: int sched_get_priority_max ( int policy )
26 : policy-priority-range ( policy -- high low )
27 [ sched_get_priority_max ] [ sched_get_priority_min ] bi ;
29 : priority-allowed? ( policy -- ? )
30 { SCHED_IDLE SCHED_OTHER SCHED_BATCH } member? not ;