compat: add TEMP_FAILURE_RETRY compatiable implementation

This commit is contained in:
Đoàn Trần Công Danh
2020-09-15 08:47:12 +07:00
parent 50439c9ca9
commit 429223635e

View File

@ -60,10 +60,19 @@
# include <sys/sendfile.h> # include <sys/sendfile.h>
#endif #endif
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#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 * static inline void *
sysprof_malloc0 (size_t size) sysprof_malloc0 (size_t size)
{ {