vfs: check userland buffers before reading them.
[haiku.git] / src / system / libroot / posix / glibc / libio / _G_config.h
blobd8c7ecf0733eabaaf70ad755e6f6979185de6ff3
1 /* This file is needed by libio to define various configuration parameters.
2 These are always the same in the GNU C library. */
4 #ifndef _G_config_h
5 #define _G_config_h 1
7 #include <libc-symbols.h>
8 #include <bits/types.h>
10 #define _GLIBCPP_USE_THREADS
11 #define _GLIBCPP_USE_WCHAR_T
13 #define _IO_MTSAFE_IO
15 /* Define types for libio in terms of the standard internal type names. */
17 #include <sys/types.h>
18 #define __need_size_t
19 #define __need_wchar_t
20 #define __need_wint_t
21 #define __need_NULL
22 #define __need_ptrdiff_t
23 #ifdef __cplusplus
24 # include <cstddef>
25 #else
26 # include <stddef.h>
27 #endif
29 #include <wchar.h>
31 #ifndef _WINT_T
32 /* Integral type unchanged by default argument promotions that can
33 hold any value corresponding to members of the extended character
34 set, as well as at least one value that does not correspond to any
35 member of the extended character set. */
36 # define _WINT_T
37 typedef unsigned int wint_t;
38 #endif
40 /* For use as part of glibc (native) or as part of libstdc++ (maybe
41 not glibc) */
42 #ifndef __c_mbstate_t_defined
43 # define __c_mbstate_t_defined 1
44 # ifdef _GLIBCPP_USE_WCHAR_T
45 typedef struct
47 void* __haiku_converter;
48 char __haiku_charset[64];
49 unsigned int __haiku_count;
50 char __haiku_data[1024 + 8]; // 1024 bytes for data, 8 for alignment space
51 int count;
52 wint_t value;
53 } __c_mbstate_t;
54 # endif
55 #endif
56 #undef __need_mbstate_t
58 typedef size_t _G_size_t;
61 #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
62 typedef struct
64 off_t __pos;
65 __c_mbstate_t __state;
66 } _G_fpos_t;
68 typedef struct
70 off_t __pos;
71 __c_mbstate_t __state;
72 } _G_fpos64_t;
73 #else
74 typedef off_t _G_fpos_t;
75 typedef off_t _G_fpos64_t;
76 #endif
77 #define __off_t off_t
78 #define _G_ssize_t ssize_t
79 #define _G_off_t off_t
80 #define _G_off64_t off_t
81 #define _G_pid_t pid_t
82 #define _G_uid_t uid_t
83 #define _G_wchar_t wchar_t
84 #define _G_wint_t wint_t
85 #define _G_stat64 stat
87 #include <iconv/gconv.h>
88 typedef union
90 struct __gconv_info __cd;
91 struct
93 struct __gconv_info __cd;
94 struct __gconv_step_data __data;
95 } __combined;
96 } _G_iconv_t;
99 typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
100 typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
101 typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
102 typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
104 #define _G_HAVE_BOOL 1
107 /* These library features are always available in the GNU C library. */
108 #define _G_HAVE_ATEXIT 1
109 #define _G_HAVE_SYS_CDEFS 1
110 #define _G_HAVE_SYS_WAIT 1
111 #define _G_NEED_STDARG_H 1
112 #define _G_va_list __gnuc_va_list
114 #define _G_HAVE_PRINTF_FP 1
115 //#define _G_HAVE_MMAP 1
116 #define _G_HAVE_LONG_DOUBLE_IO 1
117 #define _G_HAVE_IO_FILE_OPEN 1
118 #define _G_HAVE_IO_GETLINE_INFO 1
120 #define _G_IO_IO_FILE_VERSION 0x20001
122 //#define _G_OPEN64 __open64
123 //#define _G_LSEEK64 __lseek64
124 //#define _G_FSTAT64(fd,buf) __fxstat64 (_STAT_VER, fd, buf)
126 /* This is defined by <bits/stat.h> if `st_blksize' exists. */
127 /*#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)*/
129 #define _G_BUFSIZ 8192
131 /* These are the vtbl details for ELF. */
132 #define _G_NAMES_HAVE_UNDERSCORE 0
133 #define _G_VTABLE_LABEL_HAS_LENGTH 1
134 // avoid vtable-thunks, as BeOS never used those:
135 #ifdef _G_USING_THUNKS
136 #undef _G_USING_THUNKS
137 #endif /* _G_USING_THUNKS */
138 #define _G_VTABLE_LABEL_PREFIX "_vt."
139 #define _G_VTABLE_LABEL_PREFIX_ID _vt.
141 #define _G_INTERNAL_CCS "UCS4"
142 #define _G_HAVE_WEAK_SYMBOL 1
143 #define _G_STDIO_USES_LIBIO 1
145 #if defined __cplusplus || defined __STDC__
146 # define _G_ARGS(ARGLIST) ARGLIST
147 #else
148 # define _G_ARGS(ARGLIST) ()
149 #endif
151 #endif /* _G_config.h */