summaryrefslogtreecommitdiff
path: root/system/musl/0002-confstr-Add-_CS_POSIX_V7_THREADS_.patch
blob: ab1203cca0ad1fe1c6bcf8f3e93401279d82dbf3 (plain) (blame)
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
37
38
39
40
41
42
43
44
From 94046871d24d5408adaf61941a4751c77abe06b6 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Wed, 11 Apr 2018 23:23:31 -0500
Subject: [PATCH 2/2] confstr: Add _CS_POSIX_V7_THREADS_*

This is used to determine what CFLAGS/LDFLAGS are needed to enable
compilation with threads on musl.  We don't have any special ones, so
just return an empty string.

This is required to be present in <unistd.h>.
---
 include/unistd.h   | 2 ++
 src/conf/confstr.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/unistd.h b/include/unistd.h
index 2b88bbb2..68686dfd 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -460,6 +460,8 @@ int eaccess(const char *, int);
 #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS	1147
 #define _CS_V6_ENV	1148
 #define _CS_V7_ENV	1149
+#define _CS_POSIX_V7_THREADS_CFLAGS	1150
+#define _CS_POSIX_V7_THREADS_LDFLAGS	1151
 
 #ifdef __cplusplus
 }
diff --git a/src/conf/confstr.c b/src/conf/confstr.c
index 02cb1aa2..3d417284 100644
--- a/src/conf/confstr.c
+++ b/src/conf/confstr.c
@@ -7,7 +7,7 @@ size_t confstr(int name, char *buf, size_t len)
 	const char *s = "";
 	if (!name) {
 		s = "/bin:/usr/bin";
-	} else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>33U) {
+	} else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>35U) {
 		errno = EINVAL;
 		return 0;
 	}
-- 
2.15.0