blob: a36d35a98ffc20bbbef66a919267ac6bcdbe1b1e (
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
|
set prototyped
set nodefine
lib stat64 -D_LARGEFILE64_SOURCE
typ off64_t -D_LARGEFILE64_SOURCE
set define
lib opendir
hdr dirent,ndir
sys dir
nxt dirent
tst botch_d_ino_dirent64 -D_LARGEFILE64_SOURCE note{ dirent64.d_ino vs. readdir64 mismatch }end compile{
#if !__arm__
)
#endif
#include <dirent.h>
int
main()
{
struct dirent64 ent;
char aha[5-((int)sizeof(ent.d_ino))];
return sizeof(aha);
}
}end
if ( ! _lib_opendir ) {
/*
* <dirent.h> for systems with no opendir()
*/
#ifndef _DIRENT_H
#define _DIRENT_H
typedef struct
{
int dd_fd; /* file descriptor */
#ifdef _DIR_PRIVATE_
_DIR_PRIVATE_
#endif
} DIR;
struct dirent
{
long d_fileno; /* entry serial number */
int d_reclen; /* entry length */
int d_namlen; /* entry name length */
char d_name[1]; /* entry name */
};
#ifndef _DIR_PRIVATE_
#ifdef rewinddir
#undef rewinddir
#define rewinddir(p) seekdir(p,0L)
#endif
extern DIR* opendir(const char*);
extern void closedir(DIR*);
extern struct dirent* readdir(DIR*);
extern void seekdir(DIR*, long);
extern long telldir(DIR*);
#endif
#endif
}
elif ( _nxt_dirent && _lib_stat64 && _typ_off64_t && _botch_d_ino_dirent64 ) pass{
cat <<!
/*
* <dirent.h> for [fl]stat64 and off64_t with sizeof(ino64_t)==4
*/
#ifndef _AST_STD_H
#include ${_nxt_dirent-_nxt_dirent} /* the native <dirent.h> */
#else
#ifndef _DIR64_H
#define _DIR64_H
#include <ast_std.h>
#if _typ_off64_t
#undef off_t
#endif
#undef __ino64_t
#define __ino64_t int64_t
#include ${_nxt_dirent-_nxt_dirent} /* the native <dirent.h> */
#undef __ino64_t
#define __ino64_t __ino64_t
#if _typ_off64_t
#define off_t off64_t
#endif
#if _lib_readdir64 && _typ_struct_dirent64
#ifndef dirent
#define dirent dirent64
#endif
#ifndef readdir
#define readdir readdir64
#endif
#endif
#endif
#endif
!
}end
elif ( _nxt_dirent && _lib_stat64 && _typ_off64_t ) pass{
cat <<!
/*
* <dirent.h> for [fl]stat64 and off64_t
*/
#ifndef _AST_STD_H
#include ${_nxt_dirent-_nxt_dirent} /* the native <dirent.h> */
#else
#ifndef _DIR64_H
#define _DIR64_H
#include <ast_std.h>
#if _typ_off64_t
#undef off_t
#endif
#include ${_nxt_dirent-_nxt_dirent} /* the native <dirent.h> */
#if _typ_off64_t
#define off_t off64_t
#endif
#if _lib_readdir64 && _typ_struct_dirent64
#ifndef dirent
#define dirent dirent64
#endif
#ifndef readdir
#define readdir readdir64
#endif
#endif
#endif
#endif
!
}end
elif ( _nxt_dirent && _hdr_dirent ) pass{
cat <<!
/*
* <dirent.h> for systems with ok <dirent.h>
*/
#ifndef _DIRENT_H
#include ${_nxt_dirent-_nxt_dirent} /* the native <dirent.h> */
#ifndef _DIRENT_H
#define _DIRENT_H
#endif
#endif
!
}end
elif ( _hdr_ndir ) {
/*
* <dirent.h> for systems with opendir() and <ndir.h>
*/
#ifndef _DIRENT_H
#define _DIRENT_H
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide closedir opendir readdir seekdir telldir
#else
#define closedir ______closedir
#define opendir ______opendir
#define readdir ______readdir
#define seekdir ______seekdir
#define telldir ______telldir
#endif
#include <ndir.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide closedir opendir readdir seekdir telldir
#else
#undef closedir
#undef opendir
#undef readdir
#undef seekdir
#undef telldir
#endif
#ifndef dirent
#define dirent direct
#endif
#if !defined(d_fileno) && !defined(d_ino)
#define d_fileno d_ino
#endif
#ifdef rewinddir
#undef rewinddir
#define rewinddir(p) seekdir(p,0L)
#endif
extern DIR* opendir(const char*);
extern void closedir(DIR*);
extern struct dirent* readdir(DIR*);
extern void seekdir(DIR*, long);
extern long telldir(DIR*);
#endif
}
elif ( _sys_dir ) {
/*
* <dirent.h> for systems with opendir() and no <ndir.h>
*/
#ifndef _DIRENT_H
#define _DIRENT_H
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide closedir opendir readdir seekdir telldir
#else
#define closedir ______closedir
#define opendir ______opendir
#define readdir ______readdir
#define seekdir ______seekdir
#define telldir ______telldir
#endif
#include <sys/dir.h>
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide closedir opendir readdir seekdir telldir
#else
#undef closedir
#undef opendir
#undef readdir
#undef seekdir
#undef telldir
#endif
#ifndef dirent
#define dirent direct
#endif
#if !defined(d_fileno) && !defined(d_ino)
#define d_fileno d_ino
#endif
#ifdef rewinddir
#undef rewinddir
#define rewinddir(p) seekdir(p,0L)
#endif
extern DIR* opendir(const char*);
extern void closedir(DIR*);
extern struct dirent* readdir(DIR*);
extern void seekdir(DIR*, long);
extern long telldir(DIR*);
#endif
}
endif
|