KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
_types.h
Go to the documentation of this file.
1 /** \file sys/_types.h
2  \brief Internal typedefs.
3 
4  This file contains internal typedefs required by libc. You probably
5  shouldn't use any of these in your code. Most of these are copied from
6  newlib's %sys/_types.h.
7 */
8 
9 #ifndef _SYS__TYPES_H
10 #define _SYS__TYPES_H
11 
12 #include <sys/lock.h>
13 
14 // This part copied from newlib's sys/_types.h.
15 #ifndef __off_t_defined
16 /** \brief File offset type. */
17 typedef long _off_t;
18 #endif
19 
20 #ifndef __dev_t_defined
21 /** \brief Device ID type. */
22 typedef short __dev_t;
23 #endif
24 
25 #ifndef __uid_t_defined
26 /** \brief User ID type. */
27 typedef unsigned short __uid_t;
28 #endif
29 #ifndef __gid_t_defined
30 /** \brief Group ID type. */
31 typedef unsigned short __gid_t;
32 #endif
33 
34 #ifndef __off64_t_defined
35 /** \brief 64-bit file offset type. */
36 __extension__ typedef long long _off64_t;
37 #endif
38 
39 #ifndef __fpos_t_defined
40 /** \brief File position type. */
41 typedef long _fpos_t;
42 #endif
43 
44 #ifdef __LARGE64_FILES
45 #ifndef __fpos64_t_defined
46 /** \brief 64-bit file position type. */
47 typedef _off64_t _fpos64_t;
48 #endif
49 #endif
50 
51 #if defined(__INT_MAX__) && __INT_MAX__ == 2147483647
52 /** \brief Signed size type. */
53 typedef int _ssize_t;
54 #else
55 typedef long _ssize_t;
56 #endif
57 
58 /** \cond */
59 #define __need_wint_t
60 #include <stddef.h>
61 /** \endcond */
62 
63 #ifndef __mbstate_t_defined
64 /** \brief Conversion state information.
65  \headerfile sys/_types.h
66 */
67 typedef struct {
68  int __count;
69  union {
70  wint_t __wch;
71  unsigned char __wchb[4];
72  } __value; /* Value so far. */
73 } _mbstate_t;
74 #endif
75 
76 #ifndef __flock_t_defined
77 /** \brief File lock type. */
78 typedef __newlib_recursive_lock_t _flock_t;
79 #endif
80 
81 #ifndef __iconv_t_defined
82 /** \brief Iconv descriptor type. */
83 typedef void *_iconv_t;
84 #endif
85 
86 
87 // This part inserted to fix newlib brokenness.
88 /** \brief Size of an fd_set. */
89 #define FD_SETSIZE 1024
90 
91 /* The architecture should define the macro BYTE_ORDER in <arch/types.h> to
92  equal one of these macros for code that looks for these BSD-style macros. */
93 /** \brief Little Endian test macro */
94 #define LITTLE_ENDIAN 1234
95 
96 /** \brief Big Endian test macro */
97 #define BIG_ENDIAN 4321
98 
99 /** \brief PDP Endian test macro */
100 #define PDP_ENDIAN 3412
101 
102 /* Sigh... for some reason, Newlib only bothers defining these on Cygwin...
103  We're only actually concerned with AT_SYMLINK_NOFOLLOW currently. These
104  should all be defined in <fcntl.h>, by the way. */
105 #ifndef AT_EACCESS
106 /** \brief Check access using effective user and group ID */
107 #define AT_EACCESS 1
108 #endif
109 
110 #ifndef AT_SYMLINK_NOFOLLOW
111 /** \brief Do not follow symlinks */
112 #define AT_SYMLINK_NOFOLLOW 2
113 #endif
114 
115 #ifndef AT_SYMLINK_FOLLOW
116 /** \brief Follow symbolic links */
117 #define AT_SYMLINK_FOLLOW 4
118 #endif
119 
120 #ifndef AT_REMOVEDIR
121 /** \brief Remove directory instead of file */
122 #define AT_REMOVEDIR 8
123 #endif
124 
125 // And this is for old KOS source compatability.
126 #include <arch/types.h>
127 
128 // Include stuff to make pthreads work as well.
129 #include <sys/_pthread.h>
130 
131 #endif /* _SYS__TYPES_H */
unsigned short __gid_t
Group ID type.
Definition: _types.h:31
Common integer types.
unsigned short __uid_t
User ID type.
Definition: _types.h:27
wint_t __wch
Definition: _types.h:70
__newlib_recursive_lock_t _flock_t
File lock type.
Definition: _types.h:78
long _ssize_t
Definition: _types.h:55
long long _off64_t
64-bit file offset type.
Definition: _types.h:36
void * _iconv_t
Iconv descriptor type.
Definition: _types.h:83
long _fpos_t
File position type.
Definition: _types.h:41
Basic sys/_pthread.h file for newlib.
int __count
Definition: _types.h:68
short __dev_t
Device ID type.
Definition: _types.h:22
Conversion state information.
Definition: _types.h:67
long _off_t
File offset type.
Definition: _types.h:17