chiark / gitweb /
[PATCH] sync with latest version of klibc (0.107)
[elogind.git] / klibc / klibc / include / sys / types.h
1 /*
2  * sys/types.h
3  */
4
5 #ifndef _SYS_TYPES_H
6 #define _SYS_TYPES_H
7
8 #include <stddef.h>
9 #include <stdint.h>
10
11 #define _SSIZE_T
12 typedef ptrdiff_t ssize_t;
13
14 #include <linux/posix_types.h>
15 #include <asm/types.h>
16
17 /* Keeps linux/types.h from getting included elsewhere */
18 #define _LINUX_TYPES_H          
19
20 typedef __kernel_fd_set         fd_set;
21 typedef uint32_t                dev_t;
22 typedef __kernel_ino_t          ino_t;
23 typedef __kernel_mode_t         mode_t;
24 typedef __kernel_nlink_t        nlink_t;
25 typedef __kernel_off_t          off_t; /* Should become __kernel_loff_t... */
26 typedef __kernel_pid_t          pid_t;
27 typedef __kernel_daddr_t        daddr_t;
28 typedef __kernel_key_t          key_t;
29 typedef __kernel_suseconds_t    suseconds_t;
30 typedef __kernel_timer_t        timer_t;
31
32 typedef __kernel_uid32_t        uid_t;
33 typedef __kernel_gid32_t        gid_t;
34
35 typedef __kernel_loff_t         loff_t;
36
37 /*
38  * The following typedefs are also protected by individual ifdefs for
39  * historical reasons:
40  */
41 #ifndef _SIZE_T
42 #define _SIZE_T
43 typedef __kernel_size_t         size_t;
44 #endif
45
46 #ifndef _SSIZE_T
47 #define _SSIZE_T
48 typedef __kernel_ssize_t        ssize_t;
49 #endif
50
51 #ifndef _PTRDIFF_T
52 #define _PTRDIFF_T
53 typedef __kernel_ptrdiff_t      ptrdiff_t;
54 #endif
55
56 #ifndef _TIME_T
57 #define _TIME_T
58 typedef __kernel_time_t         time_t;
59 #endif
60
61 #ifndef _CLOCK_T
62 #define _CLOCK_T
63 typedef __kernel_clock_t        clock_t;
64 #endif
65
66 #ifndef _CADDR_T
67 #define _CADDR_T
68 typedef __kernel_caddr_t        caddr_t;
69 #endif
70
71 /* bsd */
72 typedef unsigned char           u_char;
73 typedef unsigned short          u_short;
74 typedef unsigned int            u_int;
75 typedef unsigned long           u_long;
76
77 /* sysv */
78 typedef unsigned char           unchar;
79 typedef unsigned short          ushort;
80 typedef unsigned int            uint;
81 typedef unsigned long           ulong;
82
83 /* Linux-specific? */
84 typedef uint8_t                 u_int8_t;
85 typedef uint16_t                u_int16_t;
86 typedef uint32_t                u_int32_t;
87 typedef uint64_t                u_int64_t;
88
89 /*
90  * transition to 64-bit sector_t, possibly making it an option...
91  */
92 #undef BLK_64BIT_SECTOR
93
94 #ifdef BLK_64BIT_SECTOR
95 typedef u64 sector_t;
96 #else
97 typedef unsigned long sector_t;
98 #endif
99
100 /*
101  * The type of an index into the pagecache.  Use a #define so asm/types.h
102  * can override it.
103  */
104 #ifndef pgoff_t
105 #define pgoff_t unsigned long
106 #endif
107
108 /*
109  * Below are truly Linux-specific types that should never collide with
110  * any application/library that wants linux/types.h.
111  */
112
113 struct ustat {
114         __kernel_daddr_t        f_tfree;
115         __kernel_ino_t          f_tinode;
116         char                    f_fname[6];
117         char                    f_fpack[6];
118 };
119
120 /*
121  * Some apps want this in <sys/types.h>
122  */
123 #include <sys/sysmacros.h>
124
125 #endif