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: |
---|
5 | |
---|
6 | typedef int gid_t; |
---|
7 | typedef int uid_t; |
---|
8 | typedef int dev_t; |
---|
9 | typedef int ino_t; |
---|
10 | typedef int mode_t; |
---|
11 | typedef int caddr_t; |
---|
12 | |
---|
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 |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef _SYS_TYPES_H |
---|
19 | |
---|
20 | #include <_ansi.h> |
---|
21 | #include <sys/cdefs.h> |
---|
22 | #include <machine/_types.h> |
---|
23 | |
---|
24 | /* BSD types permitted by POSIX and always exposed as in Glibc. Only provided |
---|
25 | for backward compatibility with BSD code. The uintN_t standard types should |
---|
26 | be preferred in new code. */ |
---|
27 | #if ___int8_t_defined |
---|
28 | typedef __uint8_t u_int8_t; |
---|
29 | #endif |
---|
30 | #if ___int16_t_defined |
---|
31 | typedef __uint16_t u_int16_t; |
---|
32 | #endif |
---|
33 | #if ___int32_t_defined |
---|
34 | typedef __uint32_t u_int32_t; |
---|
35 | #endif |
---|
36 | #if ___int64_t_defined |
---|
37 | typedef __uint64_t u_int64_t; |
---|
38 | #endif |
---|
39 | typedef int register_t; |
---|
40 | #define __BIT_TYPES_DEFINED__ 1 |
---|
41 | |
---|
42 | #if defined(__rtems__) || defined(__XMK__) |
---|
43 | /* |
---|
44 | * The following section is RTEMS specific and is needed to more |
---|
45 | * closely match the types defined in the BSD sys/types.h. |
---|
46 | * This is needed to let the RTEMS/BSD TCP/IP stack compile. |
---|
47 | */ |
---|
48 | |
---|
49 | /* deprecated */ |
---|
50 | #if ___int64_t_defined |
---|
51 | typedef __uint64_t u_quad_t; |
---|
52 | typedef __int64_t quad_t; |
---|
53 | typedef quad_t * qaddr_t; |
---|
54 | #endif |
---|
55 | |
---|
56 | #endif /* __rtems__ || __XMK__ */ |
---|
57 | |
---|
58 | #ifndef __need_inttypes |
---|
59 | |
---|
60 | #define _SYS_TYPES_H |
---|
61 | /* <stddef.h> must be before <sys/_types.h> for __size_t considerations */ |
---|
62 | #include <stddef.h> |
---|
63 | #include <sys/_types.h> |
---|
64 | #include <sys/_stdint.h> |
---|
65 | |
---|
66 | #if __BSD_VISIBLE |
---|
67 | #include <machine/endian.h> |
---|
68 | #include <sys/select.h> |
---|
69 | # define physadr physadr_t |
---|
70 | # define quad quad_t |
---|
71 | |
---|
72 | #ifndef _IN_ADDR_T_DECLARED |
---|
73 | typedef __uint32_t in_addr_t; /* base type for internet address */ |
---|
74 | #define _IN_ADDR_T_DECLARED |
---|
75 | #endif |
---|
76 | |
---|
77 | #ifndef _IN_PORT_T_DECLARED |
---|
78 | typedef __uint16_t in_port_t; |
---|
79 | #define _IN_PORT_T_DECLARED |
---|
80 | #endif |
---|
81 | #endif /* __BSD_VISIBLE */ |
---|
82 | |
---|
83 | #if __MISC_VISIBLE |
---|
84 | #ifndef _BSDTYPES_DEFINED |
---|
85 | /* also defined in mingw/gmon.h and in w32api/winsock[2].h */ |
---|
86 | #ifndef __u_char_defined |
---|
87 | typedef unsigned char u_char; |
---|
88 | #define __u_char_defined |
---|
89 | #endif |
---|
90 | #ifndef __u_short_defined |
---|
91 | typedef unsigned short u_short; |
---|
92 | #define __u_short_defined |
---|
93 | #endif |
---|
94 | #ifndef __u_int_defined |
---|
95 | typedef unsigned int u_int; |
---|
96 | #define __u_int_defined |
---|
97 | #endif |
---|
98 | #ifndef __u_long_defined |
---|
99 | typedef unsigned long u_long; |
---|
100 | #define __u_long_defined |
---|
101 | #endif |
---|
102 | #define _BSDTYPES_DEFINED |
---|
103 | #endif |
---|
104 | #endif /*__BSD_VISIBLE || __CYGWIN__ */ |
---|
105 | |
---|
106 | #if __MISC_VISIBLE |
---|
107 | typedef unsigned short ushort; /* System V compatibility */ |
---|
108 | typedef unsigned int uint; /* System V compatibility */ |
---|
109 | typedef unsigned long ulong; /* System V compatibility */ |
---|
110 | #endif |
---|
111 | |
---|
112 | #ifndef _BLKCNT_T_DECLARED |
---|
113 | typedef __blkcnt_t blkcnt_t; |
---|
114 | #define _BLKCNT_T_DECLARED |
---|
115 | #endif |
---|
116 | |
---|
117 | #ifndef _BLKSIZE_T_DECLARED |
---|
118 | typedef __blksize_t blksize_t; |
---|
119 | #define _BLKSIZE_T_DECLARED |
---|
120 | #endif |
---|
121 | |
---|
122 | #if !defined(__clock_t_defined) && !defined(_CLOCK_T_DECLARED) |
---|
123 | typedef _CLOCK_T_ clock_t; |
---|
124 | #define __clock_t_defined |
---|
125 | #define _CLOCK_T_DECLARED |
---|
126 | #endif |
---|
127 | |
---|
128 | #if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED) |
---|
129 | typedef _TIME_T_ time_t; |
---|
130 | #define __time_t_defined |
---|
131 | #define _TIME_T_DECLARED |
---|
132 | #endif |
---|
133 | |
---|
134 | #ifndef __daddr_t_defined |
---|
135 | typedef long daddr_t; |
---|
136 | #define __daddr_t_defined |
---|
137 | #endif |
---|
138 | #ifndef __caddr_t_defined |
---|
139 | typedef char * caddr_t; |
---|
140 | #define __caddr_t_defined |
---|
141 | #endif |
---|
142 | |
---|
143 | #ifndef _FSBLKCNT_T_DECLARED /* for statvfs() */ |
---|
144 | typedef __fsblkcnt_t fsblkcnt_t; |
---|
145 | typedef __fsfilcnt_t fsfilcnt_t; |
---|
146 | #define _FSBLKCNT_T_DECLARED |
---|
147 | #endif |
---|
148 | |
---|
149 | #ifndef _ID_T_DECLARED |
---|
150 | typedef __id_t id_t; /* can hold a uid_t or pid_t */ |
---|
151 | #define _ID_T_DECLARED |
---|
152 | #endif |
---|
153 | |
---|
154 | #ifndef _INO_T_DECLARED |
---|
155 | typedef __ino_t ino_t; /* inode number */ |
---|
156 | #define _INO_T_DECLARED |
---|
157 | #endif |
---|
158 | |
---|
159 | #if defined(__i386__) && (defined(GO32) || defined(__MSDOS__)) |
---|
160 | typedef char * addr_t; |
---|
161 | typedef unsigned long vm_offset_t; |
---|
162 | typedef unsigned long vm_size_t; |
---|
163 | #endif /* __i386__ && (GO32 || __MSDOS__) */ |
---|
164 | |
---|
165 | /* |
---|
166 | * All these should be machine specific - right now they are all broken. |
---|
167 | * However, for all of Cygnus' embedded targets, we want them to all be |
---|
168 | * the same. Otherwise things like sizeof (struct stat) might depend on |
---|
169 | * how the file was compiled (e.g. -mint16 vs -mint32, etc.). |
---|
170 | */ |
---|
171 | |
---|
172 | #ifndef _OFF_T_DECLARED |
---|
173 | typedef __off_t off_t; /* file offset */ |
---|
174 | #define _OFF_T_DECLARED |
---|
175 | #endif |
---|
176 | #ifndef _DEV_T_DECLARED |
---|
177 | typedef __dev_t dev_t; /* device number or struct cdev */ |
---|
178 | #define _DEV_T_DECLARED |
---|
179 | #endif |
---|
180 | #ifndef _UID_T_DECLARED |
---|
181 | typedef __uid_t uid_t; /* user id */ |
---|
182 | #define _UID_T_DECLARED |
---|
183 | #endif |
---|
184 | #ifndef _GID_T_DECLARED |
---|
185 | typedef __gid_t gid_t; /* group id */ |
---|
186 | #define _GID_T_DECLARED |
---|
187 | #endif |
---|
188 | |
---|
189 | #ifndef _PID_T_DECLARED |
---|
190 | typedef __pid_t pid_t; /* process id */ |
---|
191 | #define _PID_T_DECLARED |
---|
192 | #endif |
---|
193 | |
---|
194 | #ifndef _KEY_T_DECLARED |
---|
195 | typedef __key_t key_t; /* IPC key */ |
---|
196 | #define _KEY_T_DECLARED |
---|
197 | #endif |
---|
198 | |
---|
199 | #ifndef _SSIZE_T_DECLARED |
---|
200 | typedef _ssize_t ssize_t; |
---|
201 | #define _SSIZE_T_DECLARED |
---|
202 | #endif |
---|
203 | |
---|
204 | #ifndef _MODE_T_DECLARED |
---|
205 | typedef __mode_t mode_t; /* permissions */ |
---|
206 | #define _MODE_T_DECLARED |
---|
207 | #endif |
---|
208 | |
---|
209 | #ifndef _NLINK_T_DECLARED |
---|
210 | typedef __nlink_t nlink_t; /* link count */ |
---|
211 | #define _NLINK_T_DECLARED |
---|
212 | #endif |
---|
213 | |
---|
214 | #if !defined(__clockid_t_defined) && !defined(_CLOCKID_T_DECLARED) |
---|
215 | typedef __clockid_t clockid_t; |
---|
216 | #define __clockid_t_defined |
---|
217 | #define _CLOCKID_T_DECLARED |
---|
218 | #endif |
---|
219 | |
---|
220 | #if !defined(__timer_t_defined) && !defined(_TIMER_T_DECLARED) |
---|
221 | typedef __timer_t timer_t; |
---|
222 | #define __timer_t_defined |
---|
223 | #define _TIMER_T_DECLARED |
---|
224 | #endif |
---|
225 | |
---|
226 | #ifndef _USECONDS_T_DECLARED |
---|
227 | typedef __useconds_t useconds_t; /* microseconds (unsigned) */ |
---|
228 | #define _USECONDS_T_DECLARED |
---|
229 | #endif |
---|
230 | |
---|
231 | #ifndef _SUSECONDS_T_DECLARED |
---|
232 | typedef __suseconds_t suseconds_t; |
---|
233 | #define _SUSECONDS_T_DECLARED |
---|
234 | #endif |
---|
235 | |
---|
236 | typedef __int64_t sbintime_t; |
---|
237 | |
---|
238 | #include <sys/features.h> |
---|
239 | #include <sys/_pthreadtypes.h> |
---|
240 | #include <machine/types.h> |
---|
241 | |
---|
242 | #endif /* !__need_inttypes */ |
---|
243 | |
---|
244 | #undef __need_inttypes |
---|
245 | |
---|
246 | #endif /* _SYS_TYPES_H */ |
---|