0002-package-musl-Make-scheduler-functions-Linux-compatib.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. From 407c96fc790d0d11ca9603a2a533216c745b5051 Mon Sep 17 00:00:00 2001
  2. From: Stefan Nickl <Stefan.Nickl@gmail.com>
  3. Date: Mon, 13 May 2019 22:33:21 +0200
  4. Subject: [PATCH] Make scheduler functions Linux-compatible
  5. Let sched_getscheduler(), sched_setscheduler(), sched_getparam(),
  6. sched_setparam() invoke the Linux syscalls of the same name instead
  7. of returning -ENOSYS.
  8. Signed-off-by: Stefan Nickl <Stefan.Nickl@gmail.com>
  9. ---
  10. src/sched/sched_getparam.c | 3 +--
  11. src/sched/sched_getscheduler.c | 3 +--
  12. src/sched/sched_setparam.c | 3 +--
  13. src/sched/sched_setscheduler.c | 3 +--
  14. 4 files changed, 4 insertions(+), 8 deletions(-)
  15. diff --git a/src/sched/sched_getparam.c b/src/sched/sched_getparam.c
  16. index 76f10e4..65be107 100644
  17. --- a/src/sched/sched_getparam.c
  18. +++ b/src/sched/sched_getparam.c
  19. @@ -1,8 +1,7 @@
  20. #include <sched.h>
  21. -#include <errno.h>
  22. #include "syscall.h"
  23. int sched_getparam(pid_t pid, struct sched_param *param)
  24. {
  25. - return __syscall_ret(-ENOSYS);
  26. + return syscall(SYS_sched_getparam, pid, param);
  27. }
  28. diff --git a/src/sched/sched_getscheduler.c b/src/sched/sched_getscheduler.c
  29. index 394e508..4c922f6 100644
  30. --- a/src/sched/sched_getscheduler.c
  31. +++ b/src/sched/sched_getscheduler.c
  32. @@ -1,8 +1,7 @@
  33. #include <sched.h>
  34. -#include <errno.h>
  35. #include "syscall.h"
  36. int sched_getscheduler(pid_t pid)
  37. {
  38. - return __syscall_ret(-ENOSYS);
  39. + return syscall(SYS_sched_getscheduler, pid);
  40. }
  41. diff --git a/src/sched/sched_setparam.c b/src/sched/sched_setparam.c
  42. index 18623ee..f699faf 100644
  43. --- a/src/sched/sched_setparam.c
  44. +++ b/src/sched/sched_setparam.c
  45. @@ -1,8 +1,7 @@
  46. #include <sched.h>
  47. -#include <errno.h>
  48. #include "syscall.h"
  49. int sched_setparam(pid_t pid, const struct sched_param *param)
  50. {
  51. - return __syscall_ret(-ENOSYS);
  52. + return syscall(SYS_sched_setparam, pid, param);
  53. }
  54. diff --git a/src/sched/sched_setscheduler.c b/src/sched/sched_setscheduler.c
  55. index 4435f21..e678221 100644
  56. --- a/src/sched/sched_setscheduler.c
  57. +++ b/src/sched/sched_setscheduler.c
  58. @@ -1,8 +1,7 @@
  59. #include <sched.h>
  60. -#include <errno.h>
  61. #include "syscall.h"
  62. int sched_setscheduler(pid_t pid, int sched, const struct sched_param *param)
  63. {
  64. - return __syscall_ret(-ENOSYS);
  65. + return syscall(SYS_sched_setscheduler, pid, sched, param);
  66. }
  67. --
  68. 2.21.0