--- a/libglnx/glnx-macros.h
+++ b/libglnx/glnx-macros.h
@@ -28,6 +28,16 @@

 G_BEGIN_DECLS

+/* 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
+
 /* All of these are for C only. */
 #ifndef __GI_SCANNER__