Commit 71654257 authored by Jan Kiszka's avatar Jan Kiszka Committed by Philippe Gerum
Browse files

cobalt: Fix error code of cobalt_thread_setschedparam_ex



This aligns the return code with cobalt_sched_setschedparam_ex: If there
is no u_winoff and no thread, we should return ESRCH so that userspace
can easily detect that it should call the standard libc service instead.
Fix the core and remove the related workaround from the userspace lib.
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 7be01870
......@@ -478,7 +478,7 @@ int cobalt_thread_setschedparam_ex(unsigned long pth,
thread = thread_lookup(&hkey);
if (thread == NULL) {
if (u_winoff == NULL)
return -EINVAL;
return -ESRCH;
thread = cobalt_thread_shadow(&hkey, u_winoff);
if (IS_ERR(thread))
......
......@@ -648,7 +648,7 @@ int pthread_setschedparam_ex(pthread_t thread,
* If the kernel has no reference to the target thread. let glibc
* handle the call.
*/
if (!u_winoff_ptr && ret == EINVAL) {
if (ret == ESRCH) {
std_policy = cobalt_xlate_schedparam(policy, param_ex,
&std_param);
return __STD(pthread_setschedparam(thread, std_policy,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment