1 /* unified sys/types.h:
2 start with sef's sysvi386 version.
3 merge go32 version -- a few ifdefs.
4 h8300hms, h8300xray, and sysvnecv70 disagree on the following types:
13 however, these aren't "reasonable" values, the sysvi386 ones make far
14 more sense, and should work sufficiently well (in particular, h8300
15 doesn't have a stat, and the necv70 doesn't matter.) -- eichin
21 #if defined (_WIN32) || defined (__CYGWIN__)
26 #if defined (GO32) || defined (__MSDOS__)
32 # include <machine/types.h>
34 /* To ensure the stat struct's layout doesn't change when sizeof(int), etc.
35 changes, we assume sizeof short and long never change and have all types
36 used to define struct stat use them and not int where possible.
37 Where not possible, _ST_INTxx are used. It would be preferable to not have
38 such assumptions, but until the extra fluff is necessary, it's avoided.
39 No 64 bit targets use stat yet. What to do about them is postponed
42 #define _ST_INT32 __attribute__ ((__mode__ (__SI__)))
47 # ifndef _POSIX_SOURCE
49 # define physadr physadr_t
53 typedef unsigned char u_char;
54 typedef unsigned short u_short;
55 typedef unsigned int u_int;
56 typedef unsigned long u_long;
59 typedef unsigned short ushort; /* System V compatibility */
60 typedef unsigned int uint; /* System V compatibility */
61 # endif /*!_POSIX_SOURCE */
63 #ifndef __time_t_defined
64 typedef _TIME_T_ time_t;
65 #define __time_t_defined
69 typedef char * caddr_t;
72 typedef unsigned long ino_t;
75 typedef unsigned long ino_t;
77 typedef unsigned short ino_t;
82 typedef unsigned long vm_offset_t;
83 typedef unsigned long vm_size_t;
85 #define __BIT_TYPES_DEFINED__
88 typedef unsigned char u_int8_t;
89 typedef short int16_t;
90 typedef unsigned short u_int16_t;
92 typedef unsigned int u_int32_t;
93 typedef long long int64_t;
94 typedef unsigned long long u_int64_t;
95 typedef int32_t register_t;
96 #endif /* __MS_types__ */
99 * All these should be machine specific - right now they are all broken.
100 * However, for all of Cygnus' embedded targets, we want them to all be
101 * the same. Otherwise things like sizeof (struct stat) might depend on
102 * how the file was compiled (e.g. -mint16 vs -mint32, etc.).
109 typedef unsigned short uid_t;
110 typedef unsigned short gid_t;
113 typedef long ssize_t;
116 typedef char * addr_t;
119 #if defined (__sparc__) && !defined (__sparc_v9__)
121 typedef unsigned long mode_t;
123 typedef unsigned short mode_t;
126 typedef unsigned int mode_t _ST_INT32;
128 #endif /* ! __MS_types__ */
130 typedef unsigned short nlink_t;
132 /* We don't define fd_set and friends if we are compiling POSIX
133 source, or if we have included the Windows Sockets.h header (which
134 defines Windows versions of them). Note that a program which
135 includes the Windows sockets.h header must know what it is doing;
136 it must not call the cygwin32 select function. */
137 # if ! defined (_POSIX_SOURCE) && ! defined (_WINSOCK_H)
139 # define NBBY 8 /* number of bits in a byte */
141 * Select uses bit masks of file descriptors in longs.
142 * These macros manipulate such bit fields (the filesystem macros use chars).
143 * FD_SETSIZE may be defined by the user, but the default here
144 * should be >= NOFILE (param.h).
147 # define FD_SETSIZE 64
150 typedef long fd_mask;
151 # define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
153 # define howmany(x,y) (((x)+((y)-1))/(y))
156 /* We use a macro for fd_set so that including Sockets.h afterwards
158 typedef struct _types_fd_set {
159 fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
162 #define fd_set _types_fd_set
164 # define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
165 # define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
166 # define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
167 # define FD_ZERO(p) bzero((caddr_t)(p), sizeof (*(p)))
169 # endif /* ! defined (_POSIX_SOURCE) && ! defined (_WINSOCK_H) */
174 #endif /* _SYS_TYPES_H */
.