summaryrefslogtreecommitdiff
path: root/libc/debian/patches/use-posix-functions.patch
blob: f6b8a8ae630487e8b62e1f6e98533885166aaae4 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
Description: Use POSIX by default
Index: b/usr/src/head/pwd.h
===================================================================
--- a/usr/src/head/pwd.h
+++ b/usr/src/head/pwd.h
@@ -119,10 +119,7 @@ extern void setpwent(void);
  * only.  New applications/libraries should use the standard definitions.
  */
 
-#if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
-	defined(_POSIX_PTHREAD_SEMANTICS) || defined(__EXTENSIONS__)
-
-#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
+#ifndef __USE_LEGACY_GETPW_R
 
 #ifdef __PRAGMA_REDEFINE_EXTNAME
 #pragma redefine_extname getpwuid_r __posix_getpwuid_r
@@ -138,13 +135,6 @@ extern int __posix_getpwuid_r(uid_t, str
 extern int __posix_getpwnam_r(const char *, struct passwd *, char *,
     size_t, struct passwd **);
 
-#ifdef __lint
-
-#define	getpwuid_r __posix_getpwuid_r
-#define	getpwnam_r __posix_getpwnam_r
-
-#else	/* !__lint */
-
 static int
 getpwuid_r(uid_t __uid, struct passwd *__pwd, char *__buf, size_t __len,
     struct passwd **__res)
@@ -158,17 +148,14 @@ getpwnam_r(const char *__cb, struct pass
 	return (__posix_getpwnam_r(__cb, __pwd, __buf, __len, __res));
 }
 
-#endif /* !__lint */
 #endif /* __PRAGMA_REDEFINE_EXTNAME */
 
-#else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
+#else  /* __USE_LEGACY_GETPW_R */
 
 extern struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
 extern struct passwd *getpwnam_r(const char *, struct passwd *, char *, int);
 
-#endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
-
-#endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L)... */
+#endif /* __USE_LEGACY_GETPW_R */
 
 #ifdef	__cplusplus
 }
Index: b/usr/src/lib/libc/port/gen/getpwnam.c
===================================================================
--- a/usr/src/lib/libc/port/gen/getpwnam.c
+++ b/usr/src/lib/libc/port/gen/getpwnam.c
@@ -32,6 +32,8 @@
 #pragma weak _getpwnam = getpwnam
 #pragma weak _getpwuid = getpwuid
 
+#define __USE_LEGACY_GETPW_R
+
 #include "lint.h"
 #include <sys/types.h>
 #include <pwd.h>
Index: b/usr/src/lib/libc/port/gen/getpwnam_r.c
===================================================================
--- a/usr/src/lib/libc/port/gen/getpwnam_r.c
+++ b/usr/src/lib/libc/port/gen/getpwnam_r.c
@@ -24,6 +24,8 @@
  * Use is subject to license terms.
  */
 
+#define __USE_LEGACY_GETPW_R
+
 #include "lint.h"
 #include <sys/types.h>
 #include <pwd.h>
Index: b/usr/src/head/grp.h
===================================================================
--- a/usr/src/head/grp.h
+++ b/usr/src/head/grp.h
@@ -110,10 +110,7 @@ extern struct group *getgrent(void);		/*
  * only.  New applications/libraries should use the standard definitions.
  */
 
-#if	defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
-	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
-
-#if	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
+#ifndef __USE_LEGACY_GETGR_R
 
 #ifdef __PRAGMA_REDEFINE_EXTNAME
 #pragma redefine_extname getgrgid_r __posix_getgrgid_r
@@ -129,13 +126,6 @@ extern int __posix_getgrgid_r(gid_t, str
 extern int __posix_getgrnam_r(const char *, struct group *, char *, size_t,
     struct group **);
 
-#ifdef __lint
-
-#define	getgrgid_r __posix_getgrgid_r
-#define	getgrnam_r __posix_getgrnam_r
-
-#else	/* !__lint */
-
 static int
 getgrgid_r(gid_t __gid, struct group *__grp, char *__buf, size_t __len,
     struct group **__res)
@@ -149,17 +139,14 @@ getgrnam_r(const char *__cb, struct grou
 	return (__posix_getgrnam_r(__cb, __grp, __buf, __len, __res));
 }
 
-#endif /* !__lint */
 #endif /* __PRAGMA_REDEFINE_EXTNAME */
 
-#else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
+#else  /* __USE_LEGACY_GETGR_R */
 
 extern struct group *getgrgid_r(gid_t, struct group *, char *, int);
 extern struct group *getgrnam_r(const char *, struct group *, char *, int);
 
-#endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
-
-#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)... */
+#endif  /* __USE_LEGACY_GETGR_R */
 
 #ifdef	__cplusplus
 }
Index: b/usr/src/lib/libc/port/stdio/cuserid.c
===================================================================
--- a/usr/src/lib/libc/port/stdio/cuserid.c
+++ b/usr/src/lib/libc/port/stdio/cuserid.c
@@ -31,6 +31,8 @@
 
 #pragma weak _cuserid = cuserid
 
+#define __USE_LEGACY_GETPW_R
+
 #include "lint.h"
 #include <stdio.h>
 #include <pwd.h>
Index: b/usr/src/lib/libc/port/gen/getgrnam.c
===================================================================
--- a/usr/src/lib/libc/port/gen/getgrnam.c
+++ b/usr/src/lib/libc/port/gen/getgrnam.c
@@ -32,6 +32,8 @@
 #pragma weak _getgrnam	= getgrnam
 #pragma weak _getgrgid	= getgrgid
 
+#define __USE_LEGACY_GETGR_R
+
 #include "lint.h"
 #include <sys/types.h>
 #include <grp.h>
Index: b/usr/src/lib/libc/port/gen/getgrnam_r.c
===================================================================
--- a/usr/src/lib/libc/port/gen/getgrnam_r.c
+++ b/usr/src/lib/libc/port/gen/getgrnam_r.c
@@ -24,6 +24,8 @@
  * Use is subject to license terms.
  */
 
+#define __USE_LEGACY_GETGR_R
+
 #include "lint.h"
 #include <mtlib.h>
 #include <sys/types.h>
Index: b/usr/src/lib/libnsl/rpc/netnamer.c
===================================================================
--- a/usr/src/lib/libnsl/rpc/netnamer.c
+++ b/usr/src/lib/libnsl/rpc/netnamer.c
@@ -49,6 +49,8 @@
  */
 
 #undef NIS
+#define __USE_LEGACY_GETGR_R
+#define __USE_LEGACY_GETPW_R
 #include "mt.h"
 #include "rpc_mt.h"
 #include <stdio.h>
Index: b/usr/src/lib/libsecdb/common/getexecattr.c
===================================================================
--- a/usr/src/lib/libsecdb/common/getexecattr.c
+++ b/usr/src/lib/libsecdb/common/getexecattr.c
@@ -22,6 +22,8 @@
  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
+#define __USE_LEGACY_GETPW_R
+
 #include <sys/types.h>
 #include <stdio.h>
 #include <string.h>
Index: b/usr/src/lib/libsecdb/common/chkauthattr.c
===================================================================
--- a/usr/src/lib/libsecdb/common/chkauthattr.c
+++ b/usr/src/lib/libsecdb/common/chkauthattr.c
@@ -22,6 +22,8 @@
  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
+#define __USE_LEGACY_GETPW_R
+
 #include <alloca.h>
 #include <stdio.h>
 #include <stdlib.h>
Index: b/usr/src/lib/libsecdb/common/getuserattr.c
===================================================================
--- a/usr/src/lib/libsecdb/common/getuserattr.c
+++ b/usr/src/lib/libsecdb/common/getuserattr.c
@@ -25,6 +25,8 @@
 
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
 
+#define __USE_LEGACY_GETPW_R
+
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <stdio.h>
Index: b/usr/src/head/signal.h
===================================================================
--- a/usr/src/head/signal.h
+++ b/usr/src/head/signal.h
@@ -140,11 +140,7 @@ extern int sigqueue(pid_t, int, const un
  * sigwait() prototype is defined here.
  */
 
-#if	defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) && \
-	!defined(__XOPEN_OR_POSIX)) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
-	defined(_POSIX_PTHREAD_SEMANTICS)
-
-#if	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
+#ifndef __USE_LEGACY_SIGWAIT
 
 #ifdef __PRAGMA_REDEFINE_EXTNAME
 #pragma redefine_extname sigwait __posix_sigwait
@@ -154,26 +150,19 @@ extern int sigwait(const sigset_t *_REST
 extern int __posix_sigwait(const sigset_t *_RESTRICT_KYWD,
     int *_RESTRICT_KYWD);
 
-#ifdef	__lint
-#define	sigwait __posix_sigwait
-#else	/* !__lint */
-
 static int
 sigwait(const sigset_t *_RESTRICT_KYWD __setp, int *_RESTRICT_KYWD __signo)
 {
 	return (__posix_sigwait(__setp, __signo));
 }
 
-#endif /* !__lint */
 #endif /* __PRAGMA_REDEFINE_EXTNAME */
 
-#else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
+#else  /* __USE_LEGACY_SIGWAIT */
 
 extern int sigwait(sigset_t *);
 
-#endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
-
-#endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
+#endif  /* __USE_LEGACY_SIGWAIT */
 
 #ifdef	__cplusplus
 }
Index: b/usr/src/lib/nsswitch/nis/common/getgrent.c
===================================================================
--- a/usr/src/lib/nsswitch/nis/common/getgrent.c
+++ b/usr/src/lib/nsswitch/nis/common/getgrent.c
@@ -27,6 +27,8 @@
  * nis/getgrent.c -- "nis" backend for nsswitch "group" database
  */
 
+#define __USE_LEGACY_GETPW_R
+
 #include <grp.h>
 #include <pwd.h>
 #include "nis_common.h"
Index: b/usr/src/lib/libc/port/sys/posix_sigwait.c
===================================================================
--- a/usr/src/lib/libc/port/sys/posix_sigwait.c
+++ b/usr/src/lib/libc/port/sys/posix_sigwait.c
@@ -26,6 +26,8 @@
 
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
 
+#define __USE_LEGACY_SIGWAIT
+
 #include "lint.h"
 #include <sys/types.h>
 #include <errno.h>
Index: b/usr/src/lib/libc/port/threads/scalls.c
===================================================================
--- a/usr/src/lib/libc/port/threads/scalls.c
+++ b/usr/src/lib/libc/port/threads/scalls.c
@@ -27,6 +27,8 @@
 
 /* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
 
+#define __USE_LEGACY_SIGWAIT
+
 #include "lint.h"
 #include "thr_uberdata.h"
 #include <stdarg.h>