]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/cloudabi/cloudabi_types_common.h
MFV r322223: 8378 crash due to bp in-memory modification of nopwrite block
[FreeBSD/FreeBSD.git] / sys / contrib / cloudabi / cloudabi_types_common.h
1 // Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions
5 // are met:
6 // 1. Redistributions of source code must retain the above copyright
7 //    notice, this list of conditions and the following disclaimer.
8 // 2. Redistributions in binary form must reproduce the above copyright
9 //    notice, this list of conditions and the following disclaimer in the
10 //    documentation and/or other materials provided with the distribution.
11 //
12 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15 // ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22 // SUCH DAMAGE.
23 //
24 // This file is automatically generated. Do not edit.
25 //
26 // Source: https://github.com/NuxiNL/cloudabi
27
28 #ifndef CLOUDABI_TYPES_COMMON_H
29 #define CLOUDABI_TYPES_COMMON_H
30
31 #if defined(__FreeBSD__) && defined(_KERNEL)
32 #include <sys/types.h>
33 #elif defined(__linux__) && defined(__KERNEL__)
34 #include <linux/types.h>
35 #else
36 #include <stddef.h>
37 #include <stdint.h>
38 #endif
39
40 typedef uint8_t cloudabi_advice_t;
41 #define CLOUDABI_ADVICE_DONTNEED   1
42 #define CLOUDABI_ADVICE_NOREUSE    2
43 #define CLOUDABI_ADVICE_NORMAL     3
44 #define CLOUDABI_ADVICE_RANDOM     4
45 #define CLOUDABI_ADVICE_SEQUENTIAL 5
46 #define CLOUDABI_ADVICE_WILLNEED   6
47
48 typedef uint32_t cloudabi_auxtype_t;
49 #define CLOUDABI_AT_ARGDATA      256
50 #define CLOUDABI_AT_ARGDATALEN   257
51 #define CLOUDABI_AT_BASE           7
52 #define CLOUDABI_AT_CANARY       258
53 #define CLOUDABI_AT_CANARYLEN    259
54 #define CLOUDABI_AT_NCPUS        260
55 #define CLOUDABI_AT_NULL           0
56 #define CLOUDABI_AT_PAGESZ         6
57 #define CLOUDABI_AT_PHDR           3
58 #define CLOUDABI_AT_PHNUM          4
59 #define CLOUDABI_AT_SYSINFO_EHDR 262
60 #define CLOUDABI_AT_TID          261
61
62 typedef uint32_t cloudabi_backlog_t;
63
64 typedef uint32_t cloudabi_clockid_t;
65 #define CLOUDABI_CLOCK_MONOTONIC          1
66 #define CLOUDABI_CLOCK_PROCESS_CPUTIME_ID 2
67 #define CLOUDABI_CLOCK_REALTIME           3
68 #define CLOUDABI_CLOCK_THREAD_CPUTIME_ID  4
69
70 typedef uint32_t cloudabi_condvar_t;
71 #define CLOUDABI_CONDVAR_HAS_NO_WAITERS 0
72
73 typedef uint64_t cloudabi_device_t;
74
75 typedef uint64_t cloudabi_dircookie_t;
76 #define CLOUDABI_DIRCOOKIE_START 0
77
78 typedef uint16_t cloudabi_errno_t;
79 #define CLOUDABI_E2BIG            1
80 #define CLOUDABI_EACCES           2
81 #define CLOUDABI_EADDRINUSE       3
82 #define CLOUDABI_EADDRNOTAVAIL    4
83 #define CLOUDABI_EAFNOSUPPORT     5
84 #define CLOUDABI_EAGAIN           6
85 #define CLOUDABI_EALREADY         7
86 #define CLOUDABI_EBADF            8
87 #define CLOUDABI_EBADMSG          9
88 #define CLOUDABI_EBUSY           10
89 #define CLOUDABI_ECANCELED       11
90 #define CLOUDABI_ECHILD          12
91 #define CLOUDABI_ECONNABORTED    13
92 #define CLOUDABI_ECONNREFUSED    14
93 #define CLOUDABI_ECONNRESET      15
94 #define CLOUDABI_EDEADLK         16
95 #define CLOUDABI_EDESTADDRREQ    17
96 #define CLOUDABI_EDOM            18
97 #define CLOUDABI_EDQUOT          19
98 #define CLOUDABI_EEXIST          20
99 #define CLOUDABI_EFAULT          21
100 #define CLOUDABI_EFBIG           22
101 #define CLOUDABI_EHOSTUNREACH    23
102 #define CLOUDABI_EIDRM           24
103 #define CLOUDABI_EILSEQ          25
104 #define CLOUDABI_EINPROGRESS     26
105 #define CLOUDABI_EINTR           27
106 #define CLOUDABI_EINVAL          28
107 #define CLOUDABI_EIO             29
108 #define CLOUDABI_EISCONN         30
109 #define CLOUDABI_EISDIR          31
110 #define CLOUDABI_ELOOP           32
111 #define CLOUDABI_EMFILE          33
112 #define CLOUDABI_EMLINK          34
113 #define CLOUDABI_EMSGSIZE        35
114 #define CLOUDABI_EMULTIHOP       36
115 #define CLOUDABI_ENAMETOOLONG    37
116 #define CLOUDABI_ENETDOWN        38
117 #define CLOUDABI_ENETRESET       39
118 #define CLOUDABI_ENETUNREACH     40
119 #define CLOUDABI_ENFILE          41
120 #define CLOUDABI_ENOBUFS         42
121 #define CLOUDABI_ENODEV          43
122 #define CLOUDABI_ENOENT          44
123 #define CLOUDABI_ENOEXEC         45
124 #define CLOUDABI_ENOLCK          46
125 #define CLOUDABI_ENOLINK         47
126 #define CLOUDABI_ENOMEM          48
127 #define CLOUDABI_ENOMSG          49
128 #define CLOUDABI_ENOPROTOOPT     50
129 #define CLOUDABI_ENOSPC          51
130 #define CLOUDABI_ENOSYS          52
131 #define CLOUDABI_ENOTCONN        53
132 #define CLOUDABI_ENOTDIR         54
133 #define CLOUDABI_ENOTEMPTY       55
134 #define CLOUDABI_ENOTRECOVERABLE 56
135 #define CLOUDABI_ENOTSOCK        57
136 #define CLOUDABI_ENOTSUP         58
137 #define CLOUDABI_ENOTTY          59
138 #define CLOUDABI_ENXIO           60
139 #define CLOUDABI_EOVERFLOW       61
140 #define CLOUDABI_EOWNERDEAD      62
141 #define CLOUDABI_EPERM           63
142 #define CLOUDABI_EPIPE           64
143 #define CLOUDABI_EPROTO          65
144 #define CLOUDABI_EPROTONOSUPPORT 66
145 #define CLOUDABI_EPROTOTYPE      67
146 #define CLOUDABI_ERANGE          68
147 #define CLOUDABI_EROFS           69
148 #define CLOUDABI_ESPIPE          70
149 #define CLOUDABI_ESRCH           71
150 #define CLOUDABI_ESTALE          72
151 #define CLOUDABI_ETIMEDOUT       73
152 #define CLOUDABI_ETXTBSY         74
153 #define CLOUDABI_EXDEV           75
154 #define CLOUDABI_ENOTCAPABLE     76
155
156 typedef uint16_t cloudabi_eventrwflags_t;
157 #define CLOUDABI_EVENT_FD_READWRITE_HANGUP 0x0001
158
159 typedef uint8_t cloudabi_eventtype_t;
160 #define CLOUDABI_EVENTTYPE_CLOCK          1
161 #define CLOUDABI_EVENTTYPE_CONDVAR        2
162 #define CLOUDABI_EVENTTYPE_FD_READ        3
163 #define CLOUDABI_EVENTTYPE_FD_WRITE       4
164 #define CLOUDABI_EVENTTYPE_LOCK_RDLOCK    5
165 #define CLOUDABI_EVENTTYPE_LOCK_WRLOCK    6
166 #define CLOUDABI_EVENTTYPE_PROC_TERMINATE 7
167
168 typedef uint32_t cloudabi_exitcode_t;
169
170 typedef uint32_t cloudabi_fd_t;
171 #define CLOUDABI_PROCESS_CHILD 0xffffffff
172 #define CLOUDABI_MAP_ANON_FD   0xffffffff
173
174 typedef uint16_t cloudabi_fdflags_t;
175 #define CLOUDABI_FDFLAG_APPEND   0x0001
176 #define CLOUDABI_FDFLAG_DSYNC    0x0002
177 #define CLOUDABI_FDFLAG_NONBLOCK 0x0004
178 #define CLOUDABI_FDFLAG_RSYNC    0x0008
179 #define CLOUDABI_FDFLAG_SYNC     0x0010
180
181 typedef uint16_t cloudabi_fdsflags_t;
182 #define CLOUDABI_FDSTAT_FLAGS  0x0001
183 #define CLOUDABI_FDSTAT_RIGHTS 0x0002
184
185 typedef int64_t cloudabi_filedelta_t;
186
187 typedef uint64_t cloudabi_filesize_t;
188
189 typedef uint8_t cloudabi_filetype_t;
190 #define CLOUDABI_FILETYPE_UNKNOWN            0
191 #define CLOUDABI_FILETYPE_BLOCK_DEVICE      16
192 #define CLOUDABI_FILETYPE_CHARACTER_DEVICE  17
193 #define CLOUDABI_FILETYPE_DIRECTORY         32
194 #define CLOUDABI_FILETYPE_FIFO              48
195 #define CLOUDABI_FILETYPE_POLL              64
196 #define CLOUDABI_FILETYPE_PROCESS           80
197 #define CLOUDABI_FILETYPE_REGULAR_FILE      96
198 #define CLOUDABI_FILETYPE_SHARED_MEMORY    112
199 #define CLOUDABI_FILETYPE_SOCKET_DGRAM     128
200 #define CLOUDABI_FILETYPE_SOCKET_STREAM    130
201 #define CLOUDABI_FILETYPE_SYMBOLIC_LINK    144
202
203 typedef uint16_t cloudabi_fsflags_t;
204 #define CLOUDABI_FILESTAT_ATIM     0x0001
205 #define CLOUDABI_FILESTAT_ATIM_NOW 0x0002
206 #define CLOUDABI_FILESTAT_MTIM     0x0004
207 #define CLOUDABI_FILESTAT_MTIM_NOW 0x0008
208 #define CLOUDABI_FILESTAT_SIZE     0x0010
209
210 typedef uint64_t cloudabi_inode_t;
211
212 typedef uint32_t cloudabi_linkcount_t;
213
214 typedef uint32_t cloudabi_lock_t;
215 #define CLOUDABI_LOCK_UNLOCKED       0x00000000
216 #define CLOUDABI_LOCK_WRLOCKED       0x40000000
217 #define CLOUDABI_LOCK_KERNEL_MANAGED 0x80000000
218 #define CLOUDABI_LOCK_BOGUS          0x80000000
219
220 typedef uint32_t cloudabi_lookupflags_t;
221 #define CLOUDABI_LOOKUP_SYMLINK_FOLLOW 0x00000001
222
223 typedef uint8_t cloudabi_mflags_t;
224 #define CLOUDABI_MAP_ANON    0x01
225 #define CLOUDABI_MAP_FIXED   0x02
226 #define CLOUDABI_MAP_PRIVATE 0x04
227 #define CLOUDABI_MAP_SHARED  0x08
228
229 typedef uint8_t cloudabi_mprot_t;
230 #define CLOUDABI_PROT_EXEC  0x01
231 #define CLOUDABI_PROT_WRITE 0x02
232 #define CLOUDABI_PROT_READ  0x04
233
234 typedef uint8_t cloudabi_msflags_t;
235 #define CLOUDABI_MS_ASYNC      0x01
236 #define CLOUDABI_MS_INVALIDATE 0x02
237 #define CLOUDABI_MS_SYNC       0x04
238
239 typedef uint32_t cloudabi_nthreads_t;
240
241 typedef uint16_t cloudabi_oflags_t;
242 #define CLOUDABI_O_CREAT     0x0001
243 #define CLOUDABI_O_DIRECTORY 0x0002
244 #define CLOUDABI_O_EXCL      0x0004
245 #define CLOUDABI_O_TRUNC     0x0008
246
247 typedef uint16_t cloudabi_riflags_t;
248 #define CLOUDABI_SOCK_RECV_PEEK    0x0004
249 #define CLOUDABI_SOCK_RECV_WAITALL 0x0010
250
251 typedef uint64_t cloudabi_rights_t;
252 #define CLOUDABI_RIGHT_FD_DATASYNC            0x0000000000000001
253 #define CLOUDABI_RIGHT_FD_READ                0x0000000000000002
254 #define CLOUDABI_RIGHT_FD_SEEK                0x0000000000000004
255 #define CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS      0x0000000000000008
256 #define CLOUDABI_RIGHT_FD_SYNC                0x0000000000000010
257 #define CLOUDABI_RIGHT_FD_TELL                0x0000000000000020
258 #define CLOUDABI_RIGHT_FD_WRITE               0x0000000000000040
259 #define CLOUDABI_RIGHT_FILE_ADVISE            0x0000000000000080
260 #define CLOUDABI_RIGHT_FILE_ALLOCATE          0x0000000000000100
261 #define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY  0x0000000000000200
262 #define CLOUDABI_RIGHT_FILE_CREATE_FILE       0x0000000000000400
263 #define CLOUDABI_RIGHT_FILE_CREATE_FIFO       0x0000000000000800
264 #define CLOUDABI_RIGHT_FILE_LINK_SOURCE       0x0000000000001000
265 #define CLOUDABI_RIGHT_FILE_LINK_TARGET       0x0000000000002000
266 #define CLOUDABI_RIGHT_FILE_OPEN              0x0000000000004000
267 #define CLOUDABI_RIGHT_FILE_READDIR           0x0000000000008000
268 #define CLOUDABI_RIGHT_FILE_READLINK          0x0000000000010000
269 #define CLOUDABI_RIGHT_FILE_RENAME_SOURCE     0x0000000000020000
270 #define CLOUDABI_RIGHT_FILE_RENAME_TARGET     0x0000000000040000
271 #define CLOUDABI_RIGHT_FILE_STAT_FGET         0x0000000000080000
272 #define CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE    0x0000000000100000
273 #define CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES   0x0000000000200000
274 #define CLOUDABI_RIGHT_FILE_STAT_GET          0x0000000000400000
275 #define CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES    0x0000000000800000
276 #define CLOUDABI_RIGHT_FILE_SYMLINK           0x0000000001000000
277 #define CLOUDABI_RIGHT_FILE_UNLINK            0x0000000002000000
278 #define CLOUDABI_RIGHT_MEM_MAP                0x0000000004000000
279 #define CLOUDABI_RIGHT_MEM_MAP_EXEC           0x0000000008000000
280 #define CLOUDABI_RIGHT_POLL_FD_READWRITE      0x0000000010000000
281 #define CLOUDABI_RIGHT_POLL_MODIFY            0x0000000020000000
282 #define CLOUDABI_RIGHT_POLL_PROC_TERMINATE    0x0000000040000000
283 #define CLOUDABI_RIGHT_POLL_WAIT              0x0000000080000000
284 #define CLOUDABI_RIGHT_PROC_EXEC              0x0000000100000000
285 #define CLOUDABI_RIGHT_SOCK_ACCEPT            0x0000000200000000
286 #define CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY    0x0000000400000000
287 #define CLOUDABI_RIGHT_SOCK_BIND_SOCKET       0x0000000800000000
288 #define CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY 0x0000001000000000
289 #define CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET    0x0000002000000000
290 #define CLOUDABI_RIGHT_SOCK_LISTEN            0x0000004000000000
291 #define CLOUDABI_RIGHT_SOCK_SHUTDOWN          0x0000008000000000
292 #define CLOUDABI_RIGHT_SOCK_STAT_GET          0x0000010000000000
293
294 typedef uint16_t cloudabi_roflags_t;
295 #define CLOUDABI_SOCK_RECV_FDS_TRUNCATED  0x0001
296 #define CLOUDABI_SOCK_RECV_DATA_TRUNCATED 0x0008
297
298 typedef uint8_t cloudabi_scope_t;
299 #define CLOUDABI_SCOPE_PRIVATE 4
300 #define CLOUDABI_SCOPE_SHARED  8
301
302 typedef uint8_t cloudabi_sdflags_t;
303 #define CLOUDABI_SHUT_RD 0x01
304 #define CLOUDABI_SHUT_WR 0x02
305
306 typedef uint16_t cloudabi_siflags_t;
307
308 typedef uint8_t cloudabi_signal_t;
309 #define CLOUDABI_SIGABRT    1
310 #define CLOUDABI_SIGALRM    2
311 #define CLOUDABI_SIGBUS     3
312 #define CLOUDABI_SIGCHLD    4
313 #define CLOUDABI_SIGCONT    5
314 #define CLOUDABI_SIGFPE     6
315 #define CLOUDABI_SIGHUP     7
316 #define CLOUDABI_SIGILL     8
317 #define CLOUDABI_SIGINT     9
318 #define CLOUDABI_SIGKILL   10
319 #define CLOUDABI_SIGPIPE   11
320 #define CLOUDABI_SIGQUIT   12
321 #define CLOUDABI_SIGSEGV   13
322 #define CLOUDABI_SIGSTOP   14
323 #define CLOUDABI_SIGSYS    15
324 #define CLOUDABI_SIGTERM   16
325 #define CLOUDABI_SIGTRAP   17
326 #define CLOUDABI_SIGTSTP   18
327 #define CLOUDABI_SIGTTIN   19
328 #define CLOUDABI_SIGTTOU   20
329 #define CLOUDABI_SIGURG    21
330 #define CLOUDABI_SIGUSR1   22
331 #define CLOUDABI_SIGUSR2   23
332 #define CLOUDABI_SIGVTALRM 24
333 #define CLOUDABI_SIGXCPU   25
334 #define CLOUDABI_SIGXFSZ   26
335
336 typedef uint8_t cloudabi_ssflags_t;
337 #define CLOUDABI_SOCKSTAT_CLEAR_ERROR 0x01
338
339 typedef uint32_t cloudabi_sstate_t;
340 #define CLOUDABI_SOCKSTATE_ACCEPTCONN 0x00000001
341
342 typedef uint16_t cloudabi_subclockflags_t;
343 #define CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME 0x0001
344
345 typedef uint16_t cloudabi_subflags_t;
346 #define CLOUDABI_SUBSCRIPTION_ADD     0x0001
347 #define CLOUDABI_SUBSCRIPTION_CLEAR   0x0002
348 #define CLOUDABI_SUBSCRIPTION_DELETE  0x0004
349 #define CLOUDABI_SUBSCRIPTION_DISABLE 0x0008
350 #define CLOUDABI_SUBSCRIPTION_ENABLE  0x0010
351 #define CLOUDABI_SUBSCRIPTION_ONESHOT 0x0020
352
353 typedef uint16_t cloudabi_subrwflags_t;
354 #define CLOUDABI_SUBSCRIPTION_FD_READWRITE_POLL 0x0001
355
356 typedef uint32_t cloudabi_tid_t;
357
358 typedef uint64_t cloudabi_timestamp_t;
359
360 typedef uint8_t cloudabi_ulflags_t;
361 #define CLOUDABI_UNLINK_REMOVEDIR 0x01
362
363 typedef uint64_t cloudabi_userdata_t;
364
365 typedef uint8_t cloudabi_whence_t;
366 #define CLOUDABI_WHENCE_CUR 1
367 #define CLOUDABI_WHENCE_END 2
368 #define CLOUDABI_WHENCE_SET 3
369
370 typedef struct {
371   _Alignas(8) cloudabi_dircookie_t d_next;
372   _Alignas(8) cloudabi_inode_t d_ino;
373   _Alignas(4) uint32_t d_namlen;
374   _Alignas(1) cloudabi_filetype_t d_type;
375 } cloudabi_dirent_t;
376 _Static_assert(offsetof(cloudabi_dirent_t, d_next) == 0, "Incorrect layout");
377 _Static_assert(offsetof(cloudabi_dirent_t, d_ino) == 8, "Incorrect layout");
378 _Static_assert(offsetof(cloudabi_dirent_t, d_namlen) == 16, "Incorrect layout");
379 _Static_assert(offsetof(cloudabi_dirent_t, d_type) == 20, "Incorrect layout");
380 _Static_assert(sizeof(cloudabi_dirent_t) == 24, "Incorrect layout");
381 _Static_assert(_Alignof(cloudabi_dirent_t) == 8, "Incorrect layout");
382
383 typedef struct {
384   _Alignas(1) cloudabi_filetype_t fs_filetype;
385   _Alignas(2) cloudabi_fdflags_t fs_flags;
386   _Alignas(8) cloudabi_rights_t fs_rights_base;
387   _Alignas(8) cloudabi_rights_t fs_rights_inheriting;
388 } cloudabi_fdstat_t;
389 _Static_assert(offsetof(cloudabi_fdstat_t, fs_filetype) == 0, "Incorrect layout");
390 _Static_assert(offsetof(cloudabi_fdstat_t, fs_flags) == 2, "Incorrect layout");
391 _Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_base) == 8, "Incorrect layout");
392 _Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_inheriting) == 16, "Incorrect layout");
393 _Static_assert(sizeof(cloudabi_fdstat_t) == 24, "Incorrect layout");
394 _Static_assert(_Alignof(cloudabi_fdstat_t) == 8, "Incorrect layout");
395
396 typedef struct {
397   _Alignas(8) cloudabi_device_t st_dev;
398   _Alignas(8) cloudabi_inode_t st_ino;
399   _Alignas(1) cloudabi_filetype_t st_filetype;
400   _Alignas(4) cloudabi_linkcount_t st_nlink;
401   _Alignas(8) cloudabi_filesize_t st_size;
402   _Alignas(8) cloudabi_timestamp_t st_atim;
403   _Alignas(8) cloudabi_timestamp_t st_mtim;
404   _Alignas(8) cloudabi_timestamp_t st_ctim;
405 } cloudabi_filestat_t;
406 _Static_assert(offsetof(cloudabi_filestat_t, st_dev) == 0, "Incorrect layout");
407 _Static_assert(offsetof(cloudabi_filestat_t, st_ino) == 8, "Incorrect layout");
408 _Static_assert(offsetof(cloudabi_filestat_t, st_filetype) == 16, "Incorrect layout");
409 _Static_assert(offsetof(cloudabi_filestat_t, st_nlink) == 20, "Incorrect layout");
410 _Static_assert(offsetof(cloudabi_filestat_t, st_size) == 24, "Incorrect layout");
411 _Static_assert(offsetof(cloudabi_filestat_t, st_atim) == 32, "Incorrect layout");
412 _Static_assert(offsetof(cloudabi_filestat_t, st_mtim) == 40, "Incorrect layout");
413 _Static_assert(offsetof(cloudabi_filestat_t, st_ctim) == 48, "Incorrect layout");
414 _Static_assert(sizeof(cloudabi_filestat_t) == 56, "Incorrect layout");
415 _Static_assert(_Alignof(cloudabi_filestat_t) == 8, "Incorrect layout");
416
417 typedef struct {
418   _Alignas(4) cloudabi_fd_t fd;
419   _Alignas(4) cloudabi_lookupflags_t flags;
420 } cloudabi_lookup_t;
421 _Static_assert(offsetof(cloudabi_lookup_t, fd) == 0, "Incorrect layout");
422 _Static_assert(offsetof(cloudabi_lookup_t, flags) == 4, "Incorrect layout");
423 _Static_assert(sizeof(cloudabi_lookup_t) == 8, "Incorrect layout");
424 _Static_assert(_Alignof(cloudabi_lookup_t) == 4, "Incorrect layout");
425
426 typedef struct {
427   _Alignas(1) char ss_unused[40];
428   _Alignas(2) cloudabi_errno_t ss_error;
429   _Alignas(4) cloudabi_sstate_t ss_state;
430 } cloudabi_sockstat_t;
431 _Static_assert(offsetof(cloudabi_sockstat_t, ss_unused) == 0, "Incorrect layout");
432 _Static_assert(offsetof(cloudabi_sockstat_t, ss_error) == 40, "Incorrect layout");
433 _Static_assert(offsetof(cloudabi_sockstat_t, ss_state) == 44, "Incorrect layout");
434 _Static_assert(sizeof(cloudabi_sockstat_t) == 48, "Incorrect layout");
435 _Static_assert(_Alignof(cloudabi_sockstat_t) == 4, "Incorrect layout");
436
437 #endif