1 /*
2 Copyright (c) 1982, 1986, 1993
3 The Regents of the University of California.  All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8 1. Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in the
12 documentation and/or other materials provided with the distribution.
13 3. Neither the name of the University nor the names of its contributors
14 may be used to endorse or promote products derived from this software
15 without specific prior written permission.
16 
17 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 SUCH DAMAGE.
28  */
29 /* unified sys/types.h:
30    start with sef's sysvi386 version.
31    merge go32 version -- a few ifdefs.
32    h8300hms, h8300xray, and sysvnecv70 disagree on the following types:
33 
34    typedef int gid_t;
35    typedef int uid_t;
36    typedef int dev_t;
37    typedef int ino_t;
38    typedef int mode_t;
39    typedef int caddr_t;
40 
41    however, these aren't "reasonable" values, the sysvi386 ones make far
42    more sense, and should work sufficiently well (in particular, h8300
43    doesn't have a stat, and the necv70 doesn't matter.) -- eichin
44  */
45 
46 #ifndef _SYS_TYPES_H
47 
48 #include <sys/cdefs.h>
49 #include <machine/_types.h>
50 
51 /* BSD types permitted by POSIX and always exposed as in Glibc.  Only provided
52    for backward compatibility with BSD code.  The uintN_t standard types should
53    be preferred in new code. */
54 #if ___int8_t_defined
55 typedef __uint8_t	u_int8_t;
56 #endif
57 #if ___int16_t_defined
58 typedef __uint16_t	u_int16_t;
59 #endif
60 #if ___int32_t_defined
61 typedef __uint32_t	u_int32_t;
62 #endif
63 #if ___int64_t_defined
64 typedef __uint64_t	u_int64_t;
65 #endif
66 typedef __intptr_t register_t;
67 #define __BIT_TYPES_DEFINED__ 1
68 
69 #ifndef __need_inttypes
70 
71 #define _SYS_TYPES_H
72 #include <sys/_types.h>
73 #include <sys/_stdint.h>
74 
75 #if __BSD_VISIBLE
76 #include <machine/endian.h>
77 #  define	physadr		physadr_t
78 #  define	quad		quad_t
79 
80 #ifndef _IN_ADDR_T_DECLARED
81 typedef	__uint32_t	in_addr_t;	/* base type for internet address */
82 #define	_IN_ADDR_T_DECLARED
83 #endif
84 
85 #ifndef _IN_PORT_T_DECLARED
86 typedef	__uint16_t	in_port_t;
87 #define	_IN_PORT_T_DECLARED
88 #endif
89 
90 typedef	__uintptr_t	u_register_t;
91 #endif /* __BSD_VISIBLE */
92 
93 #if __MISC_VISIBLE
94 #ifndef _BSDTYPES_DEFINED
95 /* also defined in mingw/gmon.h and in w32api/winsock[2].h */
96 #ifndef __u_char_defined
97 typedef	unsigned char	u_char;
98 #define __u_char_defined
99 #endif
100 #ifndef __u_short_defined
101 typedef	unsigned short	u_short;
102 #define __u_short_defined
103 #endif
104 #ifndef __u_int_defined
105 typedef	unsigned int	u_int;
106 #define __u_int_defined
107 #endif
108 #ifndef __u_long_defined
109 typedef	unsigned long	u_long;
110 #define __u_long_defined
111 #endif
112 #define _BSDTYPES_DEFINED
113 #endif
114 #endif /* __MISC_VISIBLE */
115 
116 #if __MISC_VISIBLE
117 typedef	unsigned short	ushort;		/* System V compatibility */
118 typedef	unsigned int	uint;		/* System V compatibility */
119 typedef	unsigned long	ulong;		/* System V compatibility */
120 #endif
121 
122 #ifndef _BLKCNT_T_DECLARED
123 typedef	__blkcnt_t	blkcnt_t;
124 #define	_BLKCNT_T_DECLARED
125 #endif
126 
127 #ifndef _BLKSIZE_T_DECLARED
128 typedef	__blksize_t	blksize_t;
129 #define	_BLKSIZE_T_DECLARED
130 #endif
131 
132 #ifndef _CLOCK_T_DECLARED
133 typedef	_CLOCK_T_	clock_t;
134 #define	_CLOCK_T_DECLARED
135 #endif
136 
137 #ifndef _TIME_T_DECLARED
138 typedef	_TIME_T_	time_t;
139 #define	_TIME_T_DECLARED
140 #endif
141 
142 typedef	__daddr_t	daddr_t;
143 
144 #ifndef __caddr_t_defined
145 typedef	char *	caddr_t;
146 #define __caddr_t_defined
147 #endif
148 
149 #ifndef _FSBLKCNT_T_DECLARED		/* for statvfs() */
150 typedef	__fsblkcnt_t	fsblkcnt_t;
151 typedef	__fsfilcnt_t	fsfilcnt_t;
152 #define	_FSBLKCNT_T_DECLARED
153 #endif
154 
155 #ifndef _ID_T_DECLARED
156 typedef	__id_t		id_t;		/* can hold a uid_t or pid_t */
157 #define	_ID_T_DECLARED
158 #endif
159 
160 #ifndef _INO_T_DECLARED
161 typedef	__ino_t		ino_t;		/* inode number */
162 #define	_INO_T_DECLARED
163 #endif
164 
165 #if defined(__i386__) && (defined(GO32) || defined(__MSDOS__))
166 typedef	char *		addr_t;
167 typedef unsigned long vm_offset_t;
168 typedef unsigned long vm_size_t;
169 #endif /* __i386__ && (GO32 || __MSDOS__) */
170 
171 #ifndef _SSIZE_T_DECLARED
172 typedef _ssize_t ssize_t;
173 #define	_SSIZE_T_DECLARED
174 #endif
175 
176 #ifndef _OFF_T_DECLARED
177 typedef	__off_t		off_t;		/* file offset */
178 #define	_OFF_T_DECLARED
179 #endif
180 
181 #ifndef _DEV_T_DECLARED
182 typedef	__dev_t		dev_t;		/* device number or struct cdev */
183 #define	_DEV_T_DECLARED
184 #endif
185 
186 #ifndef _UID_T_DECLARED
187 typedef	__uid_t		uid_t;		/* user id */
188 #define	_UID_T_DECLARED
189 #endif
190 
191 #ifndef _GID_T_DECLARED
192 typedef	__gid_t		gid_t;		/* group id */
193 #define	_GID_T_DECLARED
194 #endif
195 
196 #ifndef _PID_T_DECLARED
197 typedef	__pid_t		pid_t;		/* process id */
198 #define	_PID_T_DECLARED
199 #endif
200 
201 #ifndef _KEY_T_DECLARED
202 typedef	__key_t		key_t;		/* IPC key */
203 #define	_KEY_T_DECLARED
204 #endif
205 
206 #ifndef _MODE_T_DECLARED
207 typedef	__mode_t	mode_t;		/* permissions */
208 #define	_MODE_T_DECLARED
209 #endif
210 
211 #ifndef _NLINK_T_DECLARED
212 typedef	__nlink_t	nlink_t;	/* link count */
213 #define	_NLINK_T_DECLARED
214 #endif
215 
216 #ifndef _CLOCKID_T_DECLARED
217 typedef	__clockid_t	clockid_t;
218 #define	_CLOCKID_T_DECLARED
219 #ifdef __ZEPHYR__
220 #define __clockid_t_defined             /* Zephyr <= 3.7 compat */
221 #endif
222 #endif
223 
224 #ifndef _TIMER_T_DECLARED
225 typedef	__timer_t	timer_t;
226 #define	_TIMER_T_DECLARED
227 #ifdef __ZEPHYR__
228 #define __timer_t_defined               /* Zephyr <= 3.7 compat */
229 #endif
230 #endif
231 
232 #ifndef _USECONDS_T_DECLARED
233 typedef	__useconds_t	useconds_t;	/* microseconds (unsigned) */
234 #define	_USECONDS_T_DECLARED
235 #endif
236 
237 #ifndef _SUSECONDS_T_DECLARED
238 typedef	__suseconds_t	suseconds_t;
239 #define	_SUSECONDS_T_DECLARED
240 #endif
241 
242 #if __BSD_VISIBLE
243 
244 #ifndef _SBINTIME_T_DECLARED
245 typedef	__int64_t	sbintime_t;
246 #define _SBINTIME_T_DECLARED
247 #endif
248 
249 #endif
250 
251 #include <sys/features.h>
252 #include <machine/types.h>
253 
254 #endif  /* !__need_inttypes */
255 
256 #undef __need_inttypes
257 
258 #include <stdint.h>
259 #define __Long int32_t
260 #define __ULong uint32_t
261 
262 #endif	/* _SYS_TYPES_H */
263