1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 14:55:07 +00:00
serenity/Ports/libuv/patches/0001-unix-Stub-out-get-set-priority-for-serenity.patch
Ali Mohammad Pur fcd56f2172 Ports: Add libuv
We've had a half-arsed port of libuv inside the cmake port, but let's
just port it properly.
Note that this pins a specific commit (which is currently the latest
commit in their default branch).
2021-07-09 15:36:50 +02:00

39 lines
993 B
Diff

From 5ac8ded61c9bcddb7b1df3ad8a23b90a777349bc 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 1/7] 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 71e9c52..004a589 100644
--- a/src/unix/core.c
+++ b/src/unix/core.c
@@ -1421,7 +1421,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);
@@ -1435,8 +1439,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;
}
--
2.32.0