1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-20 01:35:13 +03:00
aports/testing/low-memory-monitor/musl.patch
Leo 83418e9646 testing/low-memory-monitor: new aport
https://gitlab.freedesktop.org/hadess/low-memory-monitor
Daemon to monitor memory usage and signal processes and the kernel

Closes !101
2019-09-28 08:29:18 +00:00

22 lines
790 B
Diff

diff --git a/src/memory-pressure-monitor.c b/src/memory-pressure-monitor.c
index f59af0a..0863c13 100644
--- a/src/memory-pressure-monitor.c
+++ b/src/memory-pressure-monitor.c
@@ -12,6 +12,16 @@
#include <glib-unix.h>
#include <errno.h>
+/* taken from glibc unistd.h and fixes musl */
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) \
+ (__extension__ \
+ ({ long int __result; \
+ do __result = (long int) (expression); \
+ while (__result == -1L && errno == EINTR); \
+ __result; }))
+#endif
+
/* Constants */
#define MEMORY_PRESSURE_PATH "/proc/pressure/memory"