1 /* Copyright (C) 1991-2018 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
19 * POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
23 #define _SYS_TYPES_H 1
29 #include <bits/types.h>
32 # ifndef __u_char_defined
33 typedef __u_char u_char
;
34 typedef __u_short u_short
;
35 typedef __u_int u_int
;
36 typedef __u_long u_long
;
37 typedef __quad_t quad_t
;
38 typedef __u_quad_t u_quad_t
;
39 typedef __fsid_t fsid_t
;
40 # define __u_char_defined
42 typedef __loff_t loff_t
;
45 #ifndef __ino_t_defined
46 # ifndef __USE_FILE_OFFSET64
47 typedef __ino_t ino_t
;
49 typedef __ino64_t ino_t
;
51 # define __ino_t_defined
53 #if defined __USE_LARGEFILE64 && !defined __ino64_t_defined
54 typedef __ino64_t ino64_t
;
55 # define __ino64_t_defined
58 #ifndef __dev_t_defined
59 typedef __dev_t dev_t
;
60 # define __dev_t_defined
63 #ifndef __gid_t_defined
64 typedef __gid_t gid_t
;
65 # define __gid_t_defined
68 #ifndef __mode_t_defined
69 typedef __mode_t mode_t
;
70 # define __mode_t_defined
73 #ifndef __nlink_t_defined
74 typedef __nlink_t nlink_t
;
75 # define __nlink_t_defined
78 #ifndef __uid_t_defined
79 typedef __uid_t uid_t
;
80 # define __uid_t_defined
83 #ifndef __off_t_defined
84 # ifndef __USE_FILE_OFFSET64
85 typedef __off_t off_t
;
87 typedef __off64_t off_t
;
89 # define __off_t_defined
91 #if defined __USE_LARGEFILE64 && !defined __off64_t_defined
92 typedef __off64_t off64_t
;
93 # define __off64_t_defined
96 #ifndef __pid_t_defined
97 typedef __pid_t pid_t
;
98 # define __pid_t_defined
101 #if (defined __USE_XOPEN || defined __USE_XOPEN2K8) \
102 && !defined __id_t_defined
104 # define __id_t_defined
107 #ifndef __ssize_t_defined
108 typedef __ssize_t ssize_t
;
109 # define __ssize_t_defined
113 # ifndef __daddr_t_defined
114 typedef __daddr_t daddr_t
;
115 typedef __caddr_t caddr_t
;
116 # define __daddr_t_defined
120 #if (defined __USE_MISC || defined __USE_XOPEN) && !defined __key_t_defined
121 typedef __key_t key_t
;
122 # define __key_t_defined
125 #if defined __USE_XOPEN || defined __USE_XOPEN2K8
126 # include <bits/types/clock_t.h>
128 #include <bits/types/clockid_t.h>
129 #include <bits/types/time_t.h>
130 #include <bits/types/timer_t.h>
133 # ifndef __useconds_t_defined
134 typedef __useconds_t useconds_t
;
135 # define __useconds_t_defined
137 # ifndef __suseconds_t_defined
138 typedef __suseconds_t suseconds_t
;
139 # define __suseconds_t_defined
143 #define __need_size_t
147 /* Old compatibility names for C types. */
148 typedef unsigned long int ulong
;
149 typedef unsigned short int ushort
;
150 typedef unsigned int uint
;
153 /* These size-specific names are used by some of the inet code. */
155 #include <bits/stdint-intn.h>
157 #if !__GNUC_PREREQ (2, 7)
159 /* These were defined by ISO C without the first `_'. */
160 typedef unsigned char u_int8_t
;
161 typedef unsigned short int u_int16_t
;
162 typedef unsigned int u_int32_t
;
163 # if __WORDSIZE == 64
164 typedef unsigned long int u_int64_t
;
166 __extension__
typedef unsigned long long int u_int64_t
;
169 typedef int register_t
;
173 /* For GCC 2.7 and later, we can use specific type-size attributes. */
174 # define __u_intN_t(N, MODE) \
175 typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE)))
177 __u_intN_t (8, __QI__
);
178 __u_intN_t (16, __HI__
);
179 __u_intN_t (32, __SI__
);
180 __u_intN_t (64, __DI__
);
182 typedef int register_t
__attribute__ ((__mode__ (__word__
)));
185 /* Some code from BIND tests this macro to see if the types above are
188 #define __BIT_TYPES_DEFINED__ 1
192 /* In BSD <sys/types.h> is expected to define BYTE_ORDER. */
195 /* It also defines `fd_set' and the FD_* macros for `select'. */
196 # include <sys/select.h>
197 #endif /* Use misc. */
200 #if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \
201 && !defined __blksize_t_defined
202 typedef __blksize_t blksize_t
;
203 # define __blksize_t_defined
206 /* Types from the Large File Support interface. */
207 #ifndef __USE_FILE_OFFSET64
208 # ifndef __blkcnt_t_defined
209 typedef __blkcnt_t blkcnt_t
; /* Type to count number of disk blocks. */
210 # define __blkcnt_t_defined
212 # ifndef __fsblkcnt_t_defined
213 typedef __fsblkcnt_t fsblkcnt_t
; /* Type to count file system blocks. */
214 # define __fsblkcnt_t_defined
216 # ifndef __fsfilcnt_t_defined
217 typedef __fsfilcnt_t fsfilcnt_t
; /* Type to count file system inodes. */
218 # define __fsfilcnt_t_defined
221 # ifndef __blkcnt_t_defined
222 typedef __blkcnt64_t blkcnt_t
; /* Type to count number of disk blocks. */
223 # define __blkcnt_t_defined
225 # ifndef __fsblkcnt_t_defined
226 typedef __fsblkcnt64_t fsblkcnt_t
; /* Type to count file system blocks. */
227 # define __fsblkcnt_t_defined
229 # ifndef __fsfilcnt_t_defined
230 typedef __fsfilcnt64_t fsfilcnt_t
; /* Type to count file system inodes. */
231 # define __fsfilcnt_t_defined
235 #ifdef __USE_LARGEFILE64
236 typedef __blkcnt64_t blkcnt64_t
; /* Type to count number of disk blocks. */
237 typedef __fsblkcnt64_t fsblkcnt64_t
; /* Type to count file system blocks. */
238 typedef __fsfilcnt64_t fsfilcnt64_t
; /* Type to count file system inodes. */
242 /* Now add the thread types. */
243 #if defined __USE_POSIX199506 || defined __USE_UNIX98
244 # include <bits/pthreadtypes.h>
249 #endif /* sys/types.h */