Brush up some more code

This commit is contained in:
Justine Tunney 2023-07-10 10:16:55 -07:00
parent ee6566a152
commit a2d269dc38
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
32 changed files with 251 additions and 335 deletions

View file

@ -20,7 +20,6 @@
#include "libc/calls/struct/sched_param.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/intrin/midpoint.h"
#include "libc/limits.h"
#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/sched.h"
@ -67,7 +66,8 @@ TEST(sched_setscheduler, test) {
TEST(sched_setscheduler, testMidpoint) {
if (!CanTuneRealtimeSchedulers()) return;
struct sched_param p = {_midpoint(sched_get_priority_min(SCHED_FIFO),
sched_get_priority_max(SCHED_FIFO))};
struct sched_param p = {(sched_get_priority_min(SCHED_FIFO) +
sched_get_priority_max(SCHED_FIFO)) /
2};
EXPECT_SYS(0, DEFAULT_POLICY, sched_setscheduler(0, SCHED_FIFO, &p));
}