blob: 4d48d616518307a238f7be8c6111a1415e7353cb [file] [log] [blame]
Brad Bishop393846f2019-05-20 12:24:11 -04001From 19cbebc3fa33c6a1a71a6036da4d67c98f859f06 Mon Sep 17 00:00:00 2001
2From: Adrian Bunk <bunk@stusta.de>
3Date: Wed, 15 May 2019 16:08:33 +0300
4Subject: unistd.h: Add TEMP_FAILURE_RETRY
5
6Signed-off-by: Adrian Bunk <bunk@stusta.de>
7Upstream-Status: Inappropriate [oe-specific]
8---
9 include/unistd.h | 11 +++++++++++
10 1 file changed, 11 insertions(+)
11
12diff --git a/include/unistd.h b/include/unistd.h
13index 9485da7a..8a75af57 100644
14--- a/include/unistd.h
15+++ b/include/unistd.h
16@@ -460,6 +460,17 @@ int eaccess(const char *, int);
17 #define _CS_V6_ENV 1148
18 #define _CS_V7_ENV 1149
19
20+#ifdef _GNU_SOURCE
21+#ifndef TEMP_FAILURE_RETRY
22+# define TEMP_FAILURE_RETRY(expression) \
23+ (__extension__ \
24+ ({ long int __result; \
25+ do __result = (long int) (expression); \
26+ while (__result == -1L && errno == EINTR); \
27+ __result; }))
28+#endif
29+#endif
30+
31 #ifdef __cplusplus
32 }
33 #endif
34--
352.20.1
36