aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Eduardo <carana2099@gmail.com>2024-05-06 14:18:40 -0300
committerCarlos Eduardo <carana2099@gmail.com>2024-05-06 14:19:24 -0300
commitdbadd059975df04e50fe20615a89bcacd19e9218 (patch)
treec5ffff71b9b9203bf6884e58a571d392a12f9e68 /sys-process/forkstat
parentsys-kernel/ugrd: Add 1.3.6, remove 1.3.5 (diff)
downloadguru-dbadd059975df04e50fe20615a89bcacd19e9218.tar.gz
guru-dbadd059975df04e50fe20615a89bcacd19e9218.tar.bz2
guru-dbadd059975df04e50fe20615a89bcacd19e9218.zip
sys-process/forkstat: add -r support for musl
Closed as WONTFIX upstream, but the patch is simple enough and email threads linked on the bug (incluing by glibc developers) say there should be no functional difference. Bug: https://github.com/ColinIanKing/forkstat/issues/1 Signed-off-by: Carlos Eduardo <carana2099@gmail.com>
Diffstat (limited to 'sys-process/forkstat')
-rw-r--r--sys-process/forkstat/files/musl-prio.patch21
-rw-r--r--sys-process/forkstat/forkstat-0.03.02-r2.ebuild (renamed from sys-process/forkstat/forkstat-0.03.02-r1.ebuild)2
2 files changed, 22 insertions, 1 deletions
diff --git a/sys-process/forkstat/files/musl-prio.patch b/sys-process/forkstat/files/musl-prio.patch
new file mode 100644
index 000000000..bb50007be
--- /dev/null
+++ b/sys-process/forkstat/files/musl-prio.patch
@@ -0,0 +1,21 @@
+diff --git a/forkstat.c b/forkstat.c
+index 57dc9c8..4b22c42 100644
+--- a/forkstat.c
++++ b/forkstat.c
+@@ -40,6 +40,7 @@
+ #include <time.h>
+ #include <getopt.h>
+ #include <sched.h>
++#include <pthread.h>
+ #include <pwd.h>
+
+ #include <sys/ioctl.h>
+@@ -2022,7 +2023,7 @@ int main(int argc, char * const argv[])
+
+ (void)memset(&param, 0, sizeof(param));
+ param.sched_priority = max_prio;
+- if (sched_setscheduler(getpid(), policy, &param) < 0) {
++ if (pthread_setschedparam(pthread_self(), policy, &param) < 0) {
+ (void)fprintf(stderr, "sched_setscheduler failed: errno=%d (%s)\n",
+ errno, strerror(errno));
+ goto abort_sock;
diff --git a/sys-process/forkstat/forkstat-0.03.02-r1.ebuild b/sys-process/forkstat/forkstat-0.03.02-r2.ebuild
index 506288c3c..f8ea4005e 100644
--- a/sys-process/forkstat/forkstat-0.03.02-r1.ebuild
+++ b/sys-process/forkstat/forkstat-0.03.02-r2.ebuild
@@ -12,7 +12,7 @@ S="${WORKDIR}/${P}"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
-
+PATCHES=( "${FILESDIR}/musl-prio.patch" )
src_prepare() {
default
sed -i 's/8.gz/8/g' Makefile