summaryrefslogtreecommitdiff
path: root/Ports/libuv/patches/0001-unix-Stub-out-get-set-priority-for-serenity.patch
blob: 3aa8c56e66586b98e477791f5cf73b8380730d4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <ali.mpfard@gmail.com>
Date: Fri, 9 Jul 2021 04:44:26 +0430
Subject: [PATCH] unix: Stub out {get,set}priority for serenity

---
 src/unix/core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/unix/core.c b/src/unix/core.c
index def5b8f..3cdd5fa 100644
--- a/src/unix/core.c
+++ b/src/unix/core.c
@@ -1423,7 +1423,11 @@ int uv_os_getpriority(uv_pid_t pid, int* priority) {
     return UV_EINVAL;
 
   errno = 0;
+#ifndef __serenity__
   r = getpriority(PRIO_PROCESS, (int) pid);
+#else
+  r = 1;
+#endif
 
   if (r == -1 && errno != 0)
     return UV__ERR(errno);
@@ -1437,8 +1441,10 @@ int uv_os_setpriority(uv_pid_t pid, int priority) {
   if (priority < UV_PRIORITY_HIGHEST || priority > UV_PRIORITY_LOW)
     return UV_EINVAL;
 
+#ifndef __serenity__
   if (setpriority(PRIO_PROCESS, (int) pid, priority) != 0)
     return UV__ERR(errno);
+#endif
 
   return 0;
 }