summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/musl/musl/0001-unistd.h-Add-TEMP_FAILURE_RETRY.patch
blob: 4d48d616518307a238f7be8c6111a1415e7353cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 19cbebc3fa33c6a1a71a6036da4d67c98f859f06 Mon Sep 17 00:00:00 2001
From: Adrian Bunk <bunk@stusta.de>
Date: Wed, 15 May 2019 16:08:33 +0300
Subject: unistd.h: Add TEMP_FAILURE_RETRY

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Upstream-Status: Inappropriate [oe-specific]
---
 include/unistd.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/unistd.h b/include/unistd.h
index 9485da7a..8a75af57 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -460,6 +460,17 @@ int eaccess(const char *, int);
 #define _CS_V6_ENV	1148
 #define _CS_V7_ENV	1149
 
+#ifdef _GNU_SOURCE
+#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
+#endif
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.20.1