]> git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/musl/include/alltypes.h.in
Fix utimensat to avoid passing uninitialized values into WASI calls.
[wasi-libc.git] / libc-top-half / musl / include / alltypes.h.in
1 #define __LITTLE_ENDIAN 1234
2 #define __BIG_ENDIAN 4321
3 #define __USE_TIME_BITS64 1
4
5 TYPEDEF unsigned _Addr size_t;
6 TYPEDEF unsigned _Addr uintptr_t;
7 TYPEDEF _Addr ptrdiff_t;
8 TYPEDEF _Addr ssize_t;
9 TYPEDEF _Addr intptr_t;
10 TYPEDEF _Addr regoff_t;
11 TYPEDEF _Reg register_t;
12 #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
13 TYPEDEF _Int64 time_t;
14 TYPEDEF _Int64 suseconds_t;
15 #else
16 #if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
17 #include <__typedef_time_t.h>
18 #define __DEFINED_time_t
19 #endif
20
21 #if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
22 #include <__typedef_suseconds_t.h>
23 #define __DEFINED_suseconds_t
24 #endif
25 #endif
26
27 TYPEDEF signed char int8_t;
28 TYPEDEF signed short int16_t;
29 TYPEDEF signed int int32_t;
30 TYPEDEF signed _Int64 int64_t;
31 TYPEDEF signed _Int64 intmax_t;
32 TYPEDEF unsigned char uint8_t;
33 TYPEDEF unsigned short uint16_t;
34 TYPEDEF unsigned int uint32_t;
35 TYPEDEF unsigned _Int64 uint64_t;
36 TYPEDEF unsigned _Int64 u_int64_t;
37 TYPEDEF unsigned _Int64 uintmax_t;
38
39 TYPEDEF unsigned mode_t;
40 TYPEDEF unsigned _Reg nlink_t;
41 TYPEDEF _Int64 off_t;
42 TYPEDEF unsigned _Int64 ino_t;
43 TYPEDEF unsigned _Int64 dev_t;
44 TYPEDEF long blksize_t;
45 TYPEDEF _Int64 blkcnt_t;
46 TYPEDEF unsigned _Int64 fsblkcnt_t;
47 TYPEDEF unsigned _Int64 fsfilcnt_t;
48
49 TYPEDEF unsigned wint_t;
50 TYPEDEF unsigned long wctype_t;
51
52 TYPEDEF void * timer_t;
53 TYPEDEF int clockid_t;
54 TYPEDEF long clock_t;
55 #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
56 STRUCT timeval { time_t tv_sec; suseconds_t tv_usec; };
57 STRUCT timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
58 #else
59 #include <__struct_timeval.h>
60 #include <__struct_timespec.h>
61 #endif
62
63 TYPEDEF int pid_t;
64 TYPEDEF unsigned id_t;
65 TYPEDEF unsigned uid_t;
66 TYPEDEF unsigned gid_t;
67 TYPEDEF int key_t;
68 TYPEDEF unsigned useconds_t;
69
70 #ifdef __cplusplus
71 TYPEDEF unsigned long pthread_t;
72 #else
73 TYPEDEF struct __pthread * pthread_t;
74 #endif
75 TYPEDEF int pthread_once_t;
76 TYPEDEF unsigned pthread_key_t;
77 TYPEDEF int pthread_spinlock_t;
78 TYPEDEF struct { unsigned __attr; } pthread_mutexattr_t;
79 TYPEDEF struct { unsigned __attr; } pthread_condattr_t;
80 TYPEDEF struct { unsigned __attr; } pthread_barrierattr_t;
81 TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
82
83 #ifdef __wasilibc_unmodified_upstream /* WASI doesn't need to define FILE as a complete type */
84 STRUCT _IO_FILE { char __x; };
85 #endif
86 TYPEDEF struct _IO_FILE FILE;
87
88 TYPEDEF __builtin_va_list va_list;
89 TYPEDEF __builtin_va_list __isoc_va_list;
90
91 TYPEDEF struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
92
93 TYPEDEF struct __locale_struct * locale_t;
94
95 TYPEDEF struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
96
97 #ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
98 STRUCT iovec { void *iov_base; size_t iov_len; };
99 #else
100 #include <__struct_iovec.h>
101 #endif
102
103 STRUCT winsize { unsigned short ws_row, ws_col, ws_xpixel, ws_ypixel; };
104
105 TYPEDEF unsigned socklen_t;
106 TYPEDEF unsigned short sa_family_t;
107
108 TYPEDEF struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
109 TYPEDEF struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } pthread_mutex_t;
110 TYPEDEF struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
111 TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
112 TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
113 TYPEDEF struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
114 TYPEDEF struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
115
116 #undef _Addr
117 #undef _Int64
118 #undef _Reg