Rev 4921 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4921 | Rev 6099 | ||
---|---|---|---|
Line 16... | Line 16... | ||
16 | */ |
16 | */ |
Line 17... | Line 17... | ||
17 | 17 | ||
Line 18... | Line 18... | ||
18 | #ifndef _SYS_TYPES_H |
18 | #ifndef _SYS_TYPES_H |
- | 19 | ||
Line 19... | Line 20... | ||
19 | 20 | #include <_ansi.h> |
|
20 | #include <_ansi.h> |
21 | # include |
Line 21... | Line 22... | ||
21 | 22 | ||
Line 57... | Line 58... | ||
57 | 58 | ||
Line 58... | Line 59... | ||
58 | #ifndef __need_inttypes |
59 | #ifndef __need_inttypes |
59 | 60 | ||
- | 61 | #define _SYS_TYPES_H |
|
Line 60... | Line 62... | ||
60 | #define _SYS_TYPES_H |
62 | #include |
61 | #include |
63 | #include |
62 | 64 | ||
63 | #ifdef __i386__ |
65 | #ifdef __i386__ |
Line 80... | Line 82... | ||
80 | #define _ST_INT32 __attribute__ ((__mode__ (__SI__))) |
82 | #define _ST_INT32 __attribute__ ((__mode__ (__SI__))) |
81 | #else |
83 | #else |
82 | #define _ST_INT32 |
84 | #define _ST_INT32 |
83 | #endif |
85 | #endif |
Line 84... | Line 86... | ||
84 | 86 | ||
Line 85... | Line 87... | ||
85 | # ifndef _POSIX_SOURCE |
87 | # if __BSD_VISIBLE |
86 | 88 | ||
Line 87... | Line 89... | ||
87 | # define physadr physadr_t |
89 | # define physadr physadr_t |
Line 109... | Line 111... | ||
109 | #endif |
111 | #endif |
Line 110... | Line 112... | ||
110 | 112 | ||
111 | typedef unsigned short ushort; /* System V compatibility */ |
113 | typedef unsigned short ushort; /* System V compatibility */ |
112 | typedef unsigned int uint; /* System V compatibility */ |
114 | typedef unsigned int uint; /* System V compatibility */ |
113 | typedef unsigned long ulong; /* System V compatibility */ |
115 | typedef unsigned long ulong; /* System V compatibility */ |
Line 114... | Line 116... | ||
114 | # endif /*!_POSIX_SOURCE */ |
116 | # endif /*__BSD_VISIBLE */ |
115 | 117 | ||
116 | #ifndef __clock_t_defined |
118 | #ifndef __clock_t_defined |
117 | typedef _CLOCK_T_ clock_t; |
119 | typedef _CLOCK_T_ clock_t; |
Line 121... | Line 123... | ||
121 | #ifndef __time_t_defined |
123 | #ifndef __time_t_defined |
122 | typedef _TIME_T_ time_t; |
124 | typedef _TIME_T_ time_t; |
123 | #define __time_t_defined |
125 | #define __time_t_defined |
124 | #endif |
126 | #endif |
Line 125... | Line -... | ||
125 | - | ||
126 | #ifndef __timespec_defined |
- | |
127 | #define __timespec_defined |
- | |
128 | /* Time Value Specification Structures, P1003.1b-1993, p. 261 */ |
- | |
129 | - | ||
130 | struct timespec { |
- | |
131 | time_t tv_sec; /* Seconds */ |
- | |
132 | long tv_nsec; /* Nanoseconds */ |
- | |
133 | }; |
- | |
134 | #endif |
- | |
135 | - | ||
136 | struct itimerspec { |
- | |
137 | struct timespec it_interval; /* Timer period */ |
- | |
138 | struct timespec it_value; /* Timer expiration */ |
- | |
139 | }; |
- | |
140 | 127 | ||
141 | #ifndef __daddr_t_defined |
128 | #ifndef __daddr_t_defined |
142 | typedef long daddr_t; |
129 | typedef long daddr_t; |
143 | #define __daddr_t_defined |
130 | #define __daddr_t_defined |
144 | #endif |
131 | #endif |
Line 219... | Line 206... | ||
219 | #endif /* ! __MS_types__ */ |
206 | #endif /* ! __MS_types__ */ |
220 | #endif /*__CYGWIN__*/ |
207 | #endif /*__CYGWIN__*/ |
Line 221... | Line 208... | ||
221 | 208 | ||
Line 222... | Line -... | ||
222 | typedef unsigned short nlink_t; |
- | |
223 | - | ||
224 | /* We don't define fd_set and friends if we are compiling POSIX |
- | |
225 | source, or if we have included (or may include as indicated |
- | |
226 | by __USE_W32_SOCKETS) the W32api winsock[2].h header which |
- | |
227 | defines Windows versions of them. Note that a program which |
- | |
228 | includes the W32api winsock[2].h header must know what it is doing; |
- | |
229 | it must not call the cygwin32 select function. |
- | |
230 | */ |
- | |
231 | # if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) |
- | |
232 | # define _SYS_TYPES_FD_SET |
- | |
233 | # define NBBY 8 /* number of bits in a byte */ |
- | |
234 | /* |
- | |
235 | * Select uses bit masks of file descriptors in longs. |
- | |
236 | * These macros manipulate such bit fields (the filesystem macros use chars). |
- | |
237 | * FD_SETSIZE may be defined by the user, but the default here |
- | |
238 | * should be >= NOFILE (param.h). |
- | |
239 | */ |
- | |
240 | # ifndef FD_SETSIZE |
- | |
241 | # define FD_SETSIZE 64 |
- | |
242 | # endif |
- | |
243 | - | ||
244 | typedef long fd_mask; |
- | |
245 | # define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ |
- | |
246 | # ifndef howmany |
- | |
247 | # define howmany(x,y) (((x)+((y)-1))/(y)) |
- | |
248 | # endif |
- | |
249 | - | ||
250 | /* We use a macro for fd_set so that including Sockets.h afterwards |
- | |
251 | can work. */ |
- | |
252 | typedef struct _types_fd_set { |
- | |
253 | fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; |
- | |
254 | } _types_fd_set; |
- | |
255 | - | ||
256 | #define fd_set _types_fd_set |
- | |
257 | - | ||
258 | # define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS))) |
- | |
259 | # define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS))) |
- | |
260 | # define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS))) |
- | |
261 | # define FD_ZERO(p) (__extension__ (void)({ \ |
- | |
262 | size_t __i; \ |
- | |
263 | char *__tmp = (char *)p; \ |
- | |
264 | for (__i = 0; __i < sizeof (*(p)); ++__i) \ |
- | |
265 | *__tmp++ = 0; \ |
- | |
266 | })) |
- | |
267 | - | ||
268 | # endif /* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) */ |
209 | typedef unsigned short nlink_t; |
269 | 210 | ||
Line 270... | Line 211... | ||
270 | #undef __MS_types__ |
211 | #undef __MS_types__ |
Line 280... | Line 221... | ||
280 | typedef _TIMER_T_ timer_t; |
221 | typedef _TIMER_T_ timer_t; |
281 | #define __timer_t_defined |
222 | #define __timer_t_defined |
282 | #endif |
223 | #endif |
Line 283... | Line 224... | ||
283 | 224 | ||
- | 225 | typedef unsigned long useconds_t; |
|
- | 226 | ||
284 | typedef unsigned long useconds_t; |
227 | #ifndef _SUSECONDS_T_DECLARED |
- | 228 | typedef __suseconds_t suseconds_t; |
|
- | 229 | #define _SUSECONDS_T_DECLARED |
|
- | 230 | #endif |
|
- | 231 | ||
Line 285... | Line 232... | ||
285 | typedef long suseconds_t; |
232 | typedef __int64_t sbintime_t; |
Line 286... | Line 233... | ||
286 | 233 |