mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-17 19:13:13 -04:00
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>
This commit is contained in:
21
sys-process/forkstat/files/musl-prio.patch
Normal file
21
sys-process/forkstat/files/musl-prio.patch
Normal file
@@ -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(¶m, 0, sizeof(param));
|
||||
param.sched_priority = max_prio;
|
||||
- if (sched_setscheduler(getpid(), policy, ¶m) < 0) {
|
||||
+ if (pthread_setschedparam(pthread_self(), policy, ¶m) < 0) {
|
||||
(void)fprintf(stderr, "sched_setscheduler failed: errno=%d (%s)\n",
|
||||
errno, strerror(errno));
|
||||
goto abort_sock;
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user