From 429223635e5a9a1de7903465ae1e8a5eb6d61be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 15 Sep 2020 08:47:12 +0700 Subject: [PATCH] compat: add TEMP_FAILURE_RETRY compatiable implementation --- src/libsysprof-capture/sysprof-capture-util-private.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libsysprof-capture/sysprof-capture-util-private.h b/src/libsysprof-capture/sysprof-capture-util-private.h index 13ec1eed..6181212c 100644 --- a/src/libsysprof-capture/sysprof-capture-util-private.h +++ b/src/libsysprof-capture/sysprof-capture-util-private.h @@ -60,10 +60,19 @@ # include #endif +#include #include #include #include +#ifndef TEMP_FAILURE_RETRY +#define TEMP_FAILURE_RETRY(expression) \ + ({ long int __result; \ + do { __result = (long int) (expression); } \ + while (__result == -1L && errno == EINTR); \ + __result; }) +#endif + static inline void * sysprof_malloc0 (size_t size) {