diff --git a/winsup/cygwin/release/3.5.5 b/winsup/cygwin/release/3.5.5 index d91f2b92c..d41d168c6 100644 --- a/winsup/cygwin/release/3.5.5 +++ b/winsup/cygwin/release/3.5.5 @@ -45,3 +45,6 @@ Fixes: - Fix segfault in sigtimedwait() when using timeout. Addresses: https://cygwin.com/pipermail/cygwin/2024-November/256762.html + +- sched_setscheduler(2) allows to change the priority if the policy is + equal to the value returned by sched_getscheduler(2). diff --git a/winsup/cygwin/sched.cc b/winsup/cygwin/sched.cc index 39d0ed96b..a37e4f8b2 100644 --- a/winsup/cygwin/sched.cc +++ b/winsup/cygwin/sched.cc @@ -402,8 +402,11 @@ int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param) { + if (policy == SCHED_FIFO) /* returned by sched_getscheduler. */ + return sched_setparam (pid, param); + /* on win32, you can't change the scheduler. Doh! */ - set_errno (ENOSYS); + set_errno (EINVAL); return -1; }