summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch')
-rw-r--r--meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch b/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch
new file mode 100644
index 0000000000..68d819c42c
--- /dev/null
+++ b/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch
@@ -0,0 +1,57 @@
1From 60282514ea01af004d7f9e66dd3929223b7d2e7b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 18 Apr 2017 09:16:12 -0700
4Subject: [PATCH 2/2] Define glibc specific macros
5
6Check and define
7rawmemchr, __asprintf, __mempcpy, __strtok_r
8__always_inline, TEMP_FAILURE_RETRY
9
10if not existing. Helps compiling with musl
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14Upstream_status: Pending
15
16diff --git a/src/rpcsvc/nis.h b/src/rpcsvc/nis.h
17index 88cbca0..23fc20c 100644
18--- a/src/rpcsvc/nis.h
19+++ b/src/rpcsvc/nis.h
20@@ -57,6 +57,34 @@ __BEGIN_DECLS
21 * <kukuk@suse.de>
22 */
23
24+#ifndef rawmemchr
25+#define rawmemchr(s,c) memchr((s),(size_t)-1,(c))
26+#endif
27+
28+#ifndef __asprintf
29+#define __asprintf asprintf
30+#endif
31+
32+#ifndef __mempcpy
33+#define __mempcpy mempcpy
34+#endif
35+
36+#ifndef __strtok_r
37+#define __strtok_r strtok_r
38+#endif
39+
40+#ifndef __always_inline
41+#define __always_inline __attribute__((__always_inline__))
42+#endif
43+
44+#ifndef TEMP_FAILURE_RETRY
45+#define TEMP_FAILURE_RETRY(exp) ({ \
46+typeof (exp) _rc; \
47+ do { \
48+ _rc = (exp); \
49+ } while (_rc == -1 && errno == EINTR); \
50+ _rc; })
51+#endif
52
53 #ifndef __nis_object_h
54 #define __nis_object_h
55--
562.12.2
57