1pub const __bool_true_false_are_defined: u32 = 1;
4pub const true_: u32 = 1;
5pub const false_: u32 = 0;
6pub const NAME_ENTRY_LEN: u32 = 256;
7pub const FD_SETSIZE: u32 = 1024;
8pub const _DEFAULT_SOURCE: u32 = 1;
9pub const __MLIBC_BSD_OPTION: u32 = 1;
10pub const __MLIBC_LINUX_EPOLL_OPTION: u32 = 0;
11pub const __MLIBC_LINUX_TIMERFD_OPTION: u32 = 0;
12pub const __MLIBC_LINUX_SIGNALFD_OPTION: u32 = 0;
13pub const __MLIBC_POSIX_OPTION: u32 = 1;
14pub const __MLIBC_LINUX_OPTION: u32 = 0;
15pub const __MLIBC_GLIBC_OPTION: u32 = 1;
16pub const __MLIBC_SYSDEP_HAS_BITS_SYSCALL_H: u32 = 0;
17pub const __MLIBC_TWIZZLER: u32 = 1;
18pub const POLL_IN: u32 = 1;
19pub const POLL_OUT: u32 = 2;
20pub const POLL_MSG: u32 = 3;
21pub const POLL_ERR: u32 = 4;
22pub const POLL_PRI: u32 = 5;
23pub const POLL_HUP: u32 = 6;
24pub const SA_NOCLDSTOP: u32 = 1;
25pub const SA_NOCLDWAIT: u32 = 2;
26pub const SA_SIGINFO: u32 = 4;
27pub const SA_ONSTACK: u32 = 134217728;
28pub const SA_RESTART: u32 = 268435456;
29pub const SA_NODEFER: u32 = 1073741824;
30pub const SA_RESETHAND: u32 = 2147483648;
31pub const SA_RESTORER: u32 = 67108864;
32pub const SA_NOMASK: u32 = 1073741824;
33pub const SA_ONESHOT: u32 = 2147483648;
34pub const SIGABRT: u32 = 6;
35pub const SIGFPE: u32 = 8;
36pub const SIGILL: u32 = 4;
37pub const SIGINT: u32 = 2;
38pub const SIGSEGV: u32 = 11;
39pub const SIGTERM: u32 = 15;
40pub const SIGPROF: u32 = 27;
41pub const SIGIO: u32 = 29;
42pub const SIGPWR: u32 = 30;
43pub const SIGRTMIN: u32 = 35;
44pub const SIGRTMAX: u32 = 64;
45pub const SIG_BLOCK: u32 = 0;
46pub const SIG_UNBLOCK: u32 = 1;
47pub const SIG_SETMASK: u32 = 2;
48pub const SIGHUP: u32 = 1;
49pub const SIGQUIT: u32 = 3;
50pub const SIGTRAP: u32 = 5;
51pub const SIGIOT: u32 = 6;
52pub const SIGBUS: u32 = 7;
53pub const SIGKILL: u32 = 9;
54pub const SIGUSR1: u32 = 10;
55pub const SIGUSR2: u32 = 12;
56pub const SIGPIPE: u32 = 13;
57pub const SIGALRM: u32 = 14;
58pub const SIGSTKFLT: u32 = 16;
59pub const SIGCHLD: u32 = 17;
60pub const SIGCONT: u32 = 18;
61pub const SIGSTOP: u32 = 19;
62pub const SIGTSTP: u32 = 20;
63pub const SIGTTIN: u32 = 21;
64pub const SIGTTOU: u32 = 22;
65pub const SIGURG: u32 = 23;
66pub const SIGXCPU: u32 = 24;
67pub const SIGXFSZ: u32 = 25;
68pub const SIGVTALRM: u32 = 26;
69pub const SIGWINCH: u32 = 28;
70pub const SIGPOLL: u32 = 29;
71pub const SIGSYS: u32 = 31;
72pub const SIGUNUSED: u32 = 31;
73pub const SIGCANCEL: u32 = 32;
74pub const SIGTIMER: u32 = 33;
75pub const SIGEV_SIGNAL: u32 = 0;
76pub const SIGEV_NONE: u32 = 1;
77pub const SIGEV_THREAD: u32 = 2;
78pub const SIGEV_THREAD_ID: u32 = 4;
79pub const SEGV_MAPERR: u32 = 1;
80pub const SEGV_ACCERR: u32 = 2;
81pub const BUS_ADRALN: u32 = 1;
82pub const BUS_ADRERR: u32 = 2;
83pub const BUS_OBJERR: u32 = 3;
84pub const BUS_MCEERR_AR: u32 = 4;
85pub const BUS_MCEERR_AO: u32 = 5;
86pub const ILL_ILLOPC: u32 = 1;
87pub const ILL_ILLOPN: u32 = 2;
88pub const ILL_ILLADR: u32 = 3;
89pub const ILL_ILLTRP: u32 = 4;
90pub const ILL_PRVOPC: u32 = 5;
91pub const ILL_PRVREG: u32 = 6;
92pub const ILL_COPROC: u32 = 7;
93pub const ILL_BADSTK: u32 = 8;
94pub const ILL_BADIADDR: u32 = 9;
95pub const _NSIG: u32 = 65;
96pub const NSIG: u32 = 65;
97pub const SI_ASYNCNL: i32 = -60;
98pub const SI_TKILL: i32 = -6;
99pub const SI_SIGIO: i32 = -5;
100pub const SI_ASYNCIO: i32 = -4;
101pub const SI_MESGQ: i32 = -3;
102pub const SI_TIMER: i32 = -2;
103pub const SI_QUEUE: i32 = -1;
104pub const SI_USER: u32 = 0;
105pub const SI_KERNEL: u32 = 128;
106pub const __CPU_SETSIZE: u32 = 1024;
107pub const __MLIBC_THREAD_CREATE_JOINABLE: u32 = 0;
108pub const __MLIBC_THREAD_CREATE_DETACHED: u32 = 1;
109pub const __MLIBC_THREAD_MUTEX_DEFAULT: u32 = 0;
110pub const __MLIBC_THREAD_MUTEX_NORMAL: u32 = 0;
111pub const __MLIBC_THREAD_MUTEX_ERRORCHECK: u32 = 1;
112pub const __MLIBC_THREAD_MUTEX_RECURSIVE: u32 = 2;
113pub const __MLIBC_THREAD_PROCESS_PRIVATE: u32 = 0;
114pub const __MLIBC_THREAD_PROCESS_SHARED: u32 = 1;
115pub const __MLIBC_THREAD_MUTEX_STALLED: u32 = 0;
116pub const __MLIBC_THREAD_MUTEX_ROBUST: u32 = 1;
117pub const __MLIBC_THREAD_PRIO_NONE: u32 = 0;
118pub const __MLIBC_THREAD_PRIO_INHERIT: u32 = 1;
119pub const __MLIBC_THREAD_PRIO_PROTECT: u32 = 2;
120pub const __MLIBC_THREAD_DESTRUCTOR_ITERATIONS: u32 = 8;
121pub const __NGREG: u32 = 23;
122pub const POLLIN: u32 = 1;
123pub const POLLPRI: u32 = 2;
124pub const POLLOUT: u32 = 4;
125pub const POLLERR: u32 = 8;
126pub const POLLHUP: u32 = 16;
127pub const POLLNVAL: u32 = 32;
128pub const POLLRDNORM: u32 = 64;
129pub const POLLRDBAND: u32 = 128;
130pub const POLLRDHUP: u32 = 8192;
131pub const POLLWRNORM: u32 = 256;
132pub const POLLWRBAND: u32 = 512;
133pub type wchar_t = ::core::ffi::c_int;
134#[repr(C)]
135#[repr(align(16))]
136#[derive(Debug, Default, Copy, Clone)]
137pub struct max_align_t {
138 pub __clang_max_align_nonce1: ::core::ffi::c_longlong,
139 pub __bindgen_padding_0: u64,
140 pub __clang_max_align_nonce2: u128,
141}
142#[allow(clippy::unnecessary_operation, clippy::identity_op)]
143const _: () = {
144 ["Size of max_align_t"][::core::mem::size_of::<max_align_t>() - 32usize];
145 ["Alignment of max_align_t"][::core::mem::align_of::<max_align_t>() - 16usize];
146 ["Offset of field: max_align_t::__clang_max_align_nonce1"]
147 [::core::mem::offset_of!(max_align_t, __clang_max_align_nonce1) - 0usize];
148 ["Offset of field: max_align_t::__clang_max_align_nonce2"]
149 [::core::mem::offset_of!(max_align_t, __clang_max_align_nonce2) - 16usize];
150};
151pub type __mlibc_uint8 = ::core::ffi::c_uchar;
152pub type __mlibc_uint16 = ::core::ffi::c_ushort;
153pub type __mlibc_uint32 = ::core::ffi::c_uint;
154pub type __mlibc_uint64 = ::core::ffi::c_ulong;
155pub type __mlibc_int8 = ::core::ffi::c_schar;
156pub type __mlibc_int16 = ::core::ffi::c_short;
157pub type __mlibc_int32 = ::core::ffi::c_int;
158pub type __mlibc_int64 = ::core::ffi::c_long;
159pub type __mlibc_int_fast8 = __mlibc_int8;
160pub type __mlibc_int_fast16 = __mlibc_int64;
161pub type __mlibc_int_fast32 = __mlibc_int64;
162pub type __mlibc_int_fast64 = __mlibc_int64;
163pub type __mlibc_uint_fast8 = __mlibc_uint8;
164pub type __mlibc_uint_fast16 = __mlibc_uint64;
165pub type __mlibc_uint_fast32 = __mlibc_uint64;
166pub type __mlibc_uint_fast64 = __mlibc_uint64;
167pub type __mlibc_intmax = ::core::ffi::c_long;
168pub type __mlibc_intptr = ::core::ffi::c_long;
169pub type __mlibc_ptrdiff = ::core::ffi::c_long;
170pub type __mlibc_uintmax = ::core::ffi::c_ulong;
171pub type __mlibc_uintptr = ::core::ffi::c_ulong;
172pub type __mlibc_size = ::core::ffi::c_ulong;
173pub type int_least8_t = __mlibc_int8;
174pub type int_least16_t = __mlibc_int16;
175pub type int_least32_t = __mlibc_int32;
176pub type int_least64_t = __mlibc_int64;
177pub type uint_least8_t = __mlibc_uint8;
178pub type uint_least16_t = __mlibc_uint16;
179pub type uint_least32_t = __mlibc_uint32;
180pub type uint_least64_t = __mlibc_uint64;
181pub type int_fast8_t = __mlibc_int_fast8;
182pub type int_fast16_t = __mlibc_int_fast16;
183pub type int_fast32_t = __mlibc_int_fast32;
184pub type int_fast64_t = __mlibc_int_fast64;
185pub type uint_fast8_t = __mlibc_uint_fast8;
186pub type uint_fast16_t = __mlibc_uint_fast16;
187pub type uint_fast32_t = __mlibc_uint_fast32;
188pub type uint_fast64_t = __mlibc_uint_fast64;
189pub type intmax_t = __mlibc_intmax;
190pub type uintmax_t = __mlibc_uintmax;
191#[doc = " Object ID"]
192pub type objid = __uint128_t;
193#[doc = " Duration, containing seconds and nanoseconds."]
194#[repr(C)]
195#[derive(Debug, Default, Copy, Clone)]
196pub struct duration {
197 pub seconds: u64,
198 pub nanos: u32,
199}
200#[allow(clippy::unnecessary_operation, clippy::identity_op)]
201const _: () = {
202 ["Size of duration"][::core::mem::size_of::<duration>() - 16usize];
203 ["Alignment of duration"][::core::mem::align_of::<duration>() - 8usize];
204 ["Offset of field: duration::seconds"][::core::mem::offset_of!(duration, seconds) - 0usize];
205 ["Offset of field: duration::nanos"][::core::mem::offset_of!(duration, nanos) - 8usize];
206};
207#[doc = " Optional duration."]
208#[repr(C)]
209#[derive(Debug, Default, Copy, Clone)]
210pub struct option_duration {
211 pub dur: duration,
212 pub is_some: i32,
213}
214#[allow(clippy::unnecessary_operation, clippy::identity_op)]
215const _: () = {
216 ["Size of option_duration"][::core::mem::size_of::<option_duration>() - 24usize];
217 ["Alignment of option_duration"][::core::mem::align_of::<option_duration>() - 8usize];
218 ["Offset of field: option_duration::dur"]
219 [::core::mem::offset_of!(option_duration, dur) - 0usize];
220 ["Offset of field: option_duration::is_some"]
221 [::core::mem::offset_of!(option_duration, is_some) - 16usize];
222};
223unsafe extern "C" {
224 pub static NO_DURATION: option_duration;
225}
226pub type twz_error = u64;
227pub type twz_error_code = u16;
228pub type twz_error_category = u16;
229pub const ERROR_CODE_SHIFT: twz_error = 0;
230pub const ERROR_CODE_MASK: twz_error = 65535;
231pub const ERROR_CATEGORY_MASK: twz_error = 281470681743360;
232pub const ERROR_CATEGORY_SHIFT: twz_error = 32;
233pub const SUCCESS: twz_error_code = 0;
234pub const OTHER_ERROR: twz_error_code = 0;
235pub const NOT_SUPPORTED: twz_error_code = 1;
236pub const INTERNAL: twz_error_code = 2;
237pub const WOULD_BLOCK: twz_error_code = 3;
238pub const TIMED_OUT: twz_error_code = 4;
239pub const ACCESS_DENIED: twz_error_code = 5;
240pub const NO_SUCH_OPERATION: twz_error_code = 6;
241pub const INTERRUPTED: twz_error_code = 7;
242pub const IN_PROGRESS: twz_error_code = 8;
243pub const INVALID_ARGUMENT: twz_error_code = 1;
244pub const WRONG_TYPE: twz_error_code = 2;
245pub const INVALID_ADDRESS: twz_error_code = 3;
246pub const BAD_HANDLE: twz_error_code = 4;
247pub const OUT_OF_MEMORY: twz_error_code = 1;
248pub const OUT_OF_RESOURCES: twz_error_code = 2;
249pub const OUT_OF_NAMES: twz_error_code = 3;
250pub const UNAVAILABLE: twz_error_code = 4;
251pub const BUSY: twz_error_code = 5;
252pub const NOT_CONNECTED: twz_error_code = 6;
253pub const UNREACHABLE: twz_error_code = 7;
254pub const REFUSED: twz_error_code = 8;
255pub const NON_ATOMIC: twz_error_code = 9;
256pub const NOT_FOUND: twz_error_code = 1;
257pub const ALREADY_EXISTS: twz_error_code = 2;
258pub const WRONG_NAME_KIND: twz_error_code = 3;
259pub const ALREADY_BOUND: twz_error_code = 4;
260pub const INVALID_NAME: twz_error_code = 5;
261pub const LINK_LOOP: twz_error_code = 6;
262pub const NOT_EMPTY: twz_error_code = 7;
263pub const MAPPING_FAILED: twz_error_code = 1;
264pub const NOT_MAPPED: twz_error_code = 2;
265pub const INVALID_FOTE: twz_error_code = 3;
266pub const INVALID_PTR: twz_error_code = 4;
267pub const INVALID_META: twz_error_code = 5;
268pub const BASETYPE_MISMATCH: twz_error_code = 6;
269pub const NO_SUCH_OBJECT: twz_error_code = 7;
270pub const OTHER_IO_ERROR: twz_error_code = 1;
271pub const DATA_LOSS: twz_error_code = 2;
272pub const DEVICE_ERROR: twz_error_code = 3;
273pub const SEEK_FAILED: twz_error_code = 4;
274pub const RESET: twz_error_code = 5;
275pub const INVALID_KEY: twz_error_code = 1;
276pub const INVALID_SCHEME: twz_error_code = 2;
277pub const SIGNATURE_MISMATCH: twz_error_code = 3;
278pub const GATE_DENIED: twz_error_code = 4;
279pub const INVALID_GATE: twz_error_code = 5;
280pub const UNCATEGORIZED_ERROR: twz_error_category = 0;
281pub const GENERIC_ERROR: twz_error_category = 1;
282pub const ARGUMENT_ERROR: twz_error_category = 2;
283pub const RESOURCE_ERROR: twz_error_category = 3;
284pub const NAMING_ERROR: twz_error_category = 4;
285pub const OBJECT_ERROR: twz_error_category = 5;
286pub const IO_ERROR: twz_error_category = 6;
287pub const SECURITY_ERROR: twz_error_category = 7;
288#[doc = " Error or value"]
289#[repr(C)]
290#[derive(Debug, Default, Copy, Clone)]
291pub struct u32_result {
292 pub err: twz_error,
293 pub val: u32,
294}
295#[allow(clippy::unnecessary_operation, clippy::identity_op)]
296const _: () = {
297 ["Size of u32_result"][::core::mem::size_of::<u32_result>() - 16usize];
298 ["Alignment of u32_result"][::core::mem::align_of::<u32_result>() - 8usize];
299 ["Offset of field: u32_result::err"][::core::mem::offset_of!(u32_result, err) - 0usize];
300 ["Offset of field: u32_result::val"][::core::mem::offset_of!(u32_result, val) - 8usize];
301};
302#[doc = " Error or value"]
303#[repr(C)]
304#[derive(Debug, Default, Copy, Clone)]
305pub struct u64_result {
306 pub err: twz_error,
307 pub val: u64,
308}
309#[allow(clippy::unnecessary_operation, clippy::identity_op)]
310const _: () = {
311 ["Size of u64_result"][::core::mem::size_of::<u64_result>() - 16usize];
312 ["Alignment of u64_result"][::core::mem::align_of::<u64_result>() - 8usize];
313 ["Offset of field: u64_result::err"][::core::mem::offset_of!(u64_result, err) - 0usize];
314 ["Offset of field: u64_result::val"][::core::mem::offset_of!(u64_result, val) - 8usize];
315};
316#[doc = " Error or value"]
317#[repr(C)]
318#[repr(align(16))]
319#[derive(Debug, Default, Copy, Clone)]
320pub struct objid_result {
321 pub err: twz_error,
322 pub __bindgen_padding_0: u64,
323 pub val: objid,
324}
325#[allow(clippy::unnecessary_operation, clippy::identity_op)]
326const _: () = {
327 ["Size of objid_result"][::core::mem::size_of::<objid_result>() - 32usize];
328 ["Alignment of objid_result"][::core::mem::align_of::<objid_result>() - 16usize];
329 ["Offset of field: objid_result::err"][::core::mem::offset_of!(objid_result, err) - 0usize];
330 ["Offset of field: objid_result::val"][::core::mem::offset_of!(objid_result, val) - 16usize];
331};
332#[doc = " Error or value"]
333#[repr(C)]
334#[derive(Debug, Copy, Clone)]
335pub struct ptr_result {
336 pub err: twz_error,
337 pub val: *mut ::core::ffi::c_void,
338}
339#[allow(clippy::unnecessary_operation, clippy::identity_op)]
340const _: () = {
341 ["Size of ptr_result"][::core::mem::size_of::<ptr_result>() - 16usize];
342 ["Alignment of ptr_result"][::core::mem::align_of::<ptr_result>() - 8usize];
343 ["Offset of field: ptr_result::err"][::core::mem::offset_of!(ptr_result, err) - 0usize];
344 ["Offset of field: ptr_result::val"][::core::mem::offset_of!(ptr_result, val) - 8usize];
345};
346impl Default for ptr_result {
347 fn default() -> Self {
348 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
349 unsafe {
350 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
351 s.assume_init()
352 }
353 }
354}
355#[doc = " Error or value"]
356#[repr(C)]
357#[derive(Debug, Default, Copy, Clone)]
358pub struct io_result {
359 pub err: twz_error,
360 pub val: usize,
361}
362#[allow(clippy::unnecessary_operation, clippy::identity_op)]
363const _: () = {
364 ["Size of io_result"][::core::mem::size_of::<io_result>() - 16usize];
365 ["Alignment of io_result"][::core::mem::align_of::<io_result>() - 8usize];
366 ["Offset of field: io_result::err"][::core::mem::offset_of!(io_result, err) - 0usize];
367 ["Offset of field: io_result::val"][::core::mem::offset_of!(io_result, val) - 8usize];
368};
369#[doc = " Allocation flags"]
370pub type alloc_flags = u32;
371#[doc = " Zero memory during operation"]
372pub const ZERO_MEMORY: alloc_flags = 1;
373unsafe extern "C-unwind" {
374 #[doc = " Allocate memory, zeroing it first if the flag is set."]
375 pub fn twz_rt_malloc(sz: usize, align: usize, flags: alloc_flags) -> *mut ::core::ffi::c_void;
376}
377unsafe extern "C-unwind" {
378 #[doc = " Deallocate memory. If ZERO_MEMORY is set, will clear the memory before freeing."]
379 pub fn twz_rt_dealloc(
380 ptr: *mut ::core::ffi::c_void,
381 sz: usize,
382 align: usize,
383 flags: alloc_flags,
384 );
385}
386unsafe extern "C-unwind" {
387 #[doc = " Reallocate memory. If ZERO_MEMORY is set, will zero new memory before returning and zero to-be-freed memory before freeing."]
388 pub fn twz_rt_realloc(
389 ptr: *mut ::core::ffi::c_void,
390 sz: usize,
391 align: usize,
392 new_size: usize,
393 flags: alloc_flags,
394 ) -> *mut ::core::ffi::c_void;
395}
396#[doc = " Exit code type"]
397pub type exit_code = i32;
398#[doc = " Basic OS information provided to rust libstd"]
399#[repr(C)]
400#[derive(Debug, Copy, Clone)]
401pub struct basic_aux {
402 #[doc = " Number of arguments"]
403 pub argc: usize,
404 #[doc = " Pointer to args"]
405 pub args: *mut *mut ::core::ffi::c_char,
406 #[doc = " Environment pointer"]
407 pub env: *mut *mut ::core::ffi::c_char,
408 #[doc = " entry point"]
409 pub entry: usize,
410}
411#[allow(clippy::unnecessary_operation, clippy::identity_op)]
412const _: () = {
413 ["Size of basic_aux"][::core::mem::size_of::<basic_aux>() - 32usize];
414 ["Alignment of basic_aux"][::core::mem::align_of::<basic_aux>() - 8usize];
415 ["Offset of field: basic_aux::argc"][::core::mem::offset_of!(basic_aux, argc) - 0usize];
416 ["Offset of field: basic_aux::args"][::core::mem::offset_of!(basic_aux, args) - 8usize];
417 ["Offset of field: basic_aux::env"][::core::mem::offset_of!(basic_aux, env) - 16usize];
418 ["Offset of field: basic_aux::entry"][::core::mem::offset_of!(basic_aux, entry) - 24usize];
419};
420impl Default for basic_aux {
421 fn default() -> Self {
422 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
423 unsafe {
424 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
425 s.assume_init()
426 }
427 }
428}
429#[doc = " Return info from rust libstd"]
430#[repr(C)]
431#[derive(Debug, Default, Copy, Clone)]
432pub struct basic_return {
433 pub code: exit_code,
434}
435#[allow(clippy::unnecessary_operation, clippy::identity_op)]
436const _: () = {
437 ["Size of basic_return"][::core::mem::size_of::<basic_return>() - 4usize];
438 ["Alignment of basic_return"][::core::mem::align_of::<basic_return>() - 4usize];
439 ["Offset of field: basic_return::code"][::core::mem::offset_of!(basic_return, code) - 0usize];
440};
441#[repr(C)]
442#[derive(Debug, Copy, Clone)]
443pub struct ctor_set {
444 #[doc = " Fn ptr to _init"]
445 pub legacy_init: ::core::option::Option<unsafe extern "C-unwind" fn()>,
446 #[doc = " Pointer to the init array"]
447 pub init_array: *mut ::core::option::Option<unsafe extern "C-unwind" fn()>,
448 #[doc = " Length of init array"]
449 pub init_array_len: usize,
450}
451#[allow(clippy::unnecessary_operation, clippy::identity_op)]
452const _: () = {
453 ["Size of ctor_set"][::core::mem::size_of::<ctor_set>() - 24usize];
454 ["Alignment of ctor_set"][::core::mem::align_of::<ctor_set>() - 8usize];
455 ["Offset of field: ctor_set::legacy_init"]
456 [::core::mem::offset_of!(ctor_set, legacy_init) - 0usize];
457 ["Offset of field: ctor_set::init_array"]
458 [::core::mem::offset_of!(ctor_set, init_array) - 8usize];
459 ["Offset of field: ctor_set::init_array_len"]
460 [::core::mem::offset_of!(ctor_set, init_array_len) - 16usize];
461};
462impl Default for ctor_set {
463 fn default() -> Self {
464 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
465 unsafe {
466 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
467 s.assume_init()
468 }
469 }
470}
471#[doc = " Init information for compartments"]
472#[repr(C)]
473#[derive(Debug, Copy, Clone)]
474pub struct comp_init_info {
475 #[doc = " Pointer to ctor_set list"]
476 pub ctor_set_array: *mut ctor_set,
477 #[doc = " Length of ctor_set array"]
478 pub ctor_set_len: usize,
479 #[doc = " Pointer to compartment config info"]
480 pub comp_config_info: *mut ::core::ffi::c_void,
481}
482#[allow(clippy::unnecessary_operation, clippy::identity_op)]
483const _: () = {
484 ["Size of comp_init_info"][::core::mem::size_of::<comp_init_info>() - 24usize];
485 ["Alignment of comp_init_info"][::core::mem::align_of::<comp_init_info>() - 8usize];
486 ["Offset of field: comp_init_info::ctor_set_array"]
487 [::core::mem::offset_of!(comp_init_info, ctor_set_array) - 0usize];
488 ["Offset of field: comp_init_info::ctor_set_len"]
489 [::core::mem::offset_of!(comp_init_info, ctor_set_len) - 8usize];
490 ["Offset of field: comp_init_info::comp_config_info"]
491 [::core::mem::offset_of!(comp_init_info, comp_config_info) - 16usize];
492};
493impl Default for comp_init_info {
494 fn default() -> Self {
495 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
496 unsafe {
497 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
498 s.assume_init()
499 }
500 }
501}
502#[doc = " Init information for minimal runtime"]
503#[repr(C)]
504#[derive(Debug, Copy, Clone)]
505pub struct minimal_init_info {
506 #[doc = " Pointer to program headers"]
507 pub phdrs: *mut ::core::ffi::c_void,
508 #[doc = " Number of program headers"]
509 pub nr_phdrs: usize,
510}
511#[allow(clippy::unnecessary_operation, clippy::identity_op)]
512const _: () = {
513 ["Size of minimal_init_info"][::core::mem::size_of::<minimal_init_info>() - 16usize];
514 ["Alignment of minimal_init_info"][::core::mem::align_of::<minimal_init_info>() - 8usize];
515 ["Offset of field: minimal_init_info::phdrs"]
516 [::core::mem::offset_of!(minimal_init_info, phdrs) - 0usize];
517 ["Offset of field: minimal_init_info::nr_phdrs"]
518 [::core::mem::offset_of!(minimal_init_info, nr_phdrs) - 8usize];
519};
520impl Default for minimal_init_info {
521 fn default() -> Self {
522 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
523 unsafe {
524 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
525 s.assume_init()
526 }
527 }
528}
529#[doc = " Possible init info types"]
530#[repr(C)]
531#[derive(Copy, Clone)]
532pub union init_info_ptrs {
533 pub comp: *mut comp_init_info,
534 pub min: *mut minimal_init_info,
535 pub monitor: *mut ::core::ffi::c_void,
536}
537#[allow(clippy::unnecessary_operation, clippy::identity_op)]
538const _: () = {
539 ["Size of init_info_ptrs"][::core::mem::size_of::<init_info_ptrs>() - 8usize];
540 ["Alignment of init_info_ptrs"][::core::mem::align_of::<init_info_ptrs>() - 8usize];
541 ["Offset of field: init_info_ptrs::comp"]
542 [::core::mem::offset_of!(init_info_ptrs, comp) - 0usize];
543 ["Offset of field: init_info_ptrs::min"][::core::mem::offset_of!(init_info_ptrs, min) - 0usize];
544 ["Offset of field: init_info_ptrs::monitor"]
545 [::core::mem::offset_of!(init_info_ptrs, monitor) - 0usize];
546};
547impl Default for init_info_ptrs {
548 fn default() -> Self {
549 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
550 unsafe {
551 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
552 s.assume_init()
553 }
554 }
555}
556#[doc = " Runtime initialization info."]
557#[repr(C)]
558#[derive(Copy, Clone)]
559pub struct runtime_info {
560 pub flags: i32,
561 #[doc = " Discrim. for init_info."]
562 pub kind: i32,
563 #[doc = " Pointer to args"]
564 pub args: *mut *mut ::core::ffi::c_char,
565 #[doc = " Number of args"]
566 pub argc: usize,
567 #[doc = " Environment pointer"]
568 pub envp: *mut *mut ::core::ffi::c_char,
569 #[doc = " Entry point for ELF file"]
570 pub entry: usize,
571 pub init_info: init_info_ptrs,
572}
573#[allow(clippy::unnecessary_operation, clippy::identity_op)]
574const _: () = {
575 ["Size of runtime_info"][::core::mem::size_of::<runtime_info>() - 48usize];
576 ["Alignment of runtime_info"][::core::mem::align_of::<runtime_info>() - 8usize];
577 ["Offset of field: runtime_info::flags"][::core::mem::offset_of!(runtime_info, flags) - 0usize];
578 ["Offset of field: runtime_info::kind"][::core::mem::offset_of!(runtime_info, kind) - 4usize];
579 ["Offset of field: runtime_info::args"][::core::mem::offset_of!(runtime_info, args) - 8usize];
580 ["Offset of field: runtime_info::argc"][::core::mem::offset_of!(runtime_info, argc) - 16usize];
581 ["Offset of field: runtime_info::envp"][::core::mem::offset_of!(runtime_info, envp) - 24usize];
582 ["Offset of field: runtime_info::entry"]
583 [::core::mem::offset_of!(runtime_info, entry) - 32usize];
584 ["Offset of field: runtime_info::init_info"]
585 [::core::mem::offset_of!(runtime_info, init_info) - 40usize];
586};
587impl Default for runtime_info {
588 fn default() -> Self {
589 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
590 unsafe {
591 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
592 s.assume_init()
593 }
594 }
595}
596#[doc = " Minimal runtime info"]
597pub const RUNTIME_INIT_MIN: i32 = 0;
598#[doc = " Info for monitor"]
599pub const RUNTIME_INIT_MONITOR: i32 = 1;
600#[doc = " Info for compartments"]
601pub const RUNTIME_INIT_COMP: i32 = 2;
602#[doc = " Optional exit code"]
603#[repr(C)]
604#[derive(Debug, Default, Copy, Clone)]
605pub struct option_exit_code {
606 pub is_some: i32,
607 pub value: exit_code,
608}
609#[allow(clippy::unnecessary_operation, clippy::identity_op)]
610const _: () = {
611 ["Size of option_exit_code"][::core::mem::size_of::<option_exit_code>() - 8usize];
612 ["Alignment of option_exit_code"][::core::mem::align_of::<option_exit_code>() - 4usize];
613 ["Offset of field: option_exit_code::is_some"]
614 [::core::mem::offset_of!(option_exit_code, is_some) - 0usize];
615 ["Offset of field: option_exit_code::value"]
616 [::core::mem::offset_of!(option_exit_code, value) - 4usize];
617};
618unsafe extern "C-unwind" {
619 #[doc = " Exit with provided code"]
620 pub fn twz_rt_exit(code: exit_code);
621}
622unsafe extern "C-unwind" {
623 #[doc = " Abort immediately"]
624 pub fn twz_rt_abort();
625}
626unsafe extern "C-unwind" {
627 #[doc = " Signal the runtime to prep for entry from another compartment"]
628 pub fn twz_rt_cross_compartment_entry() -> bool;
629}
630unsafe extern "C-unwind" {
631 #[doc = " Set the handler for an upcall from kernel"]
632 pub fn twz_rt_set_upcall_handler(
633 handler: ::core::option::Option<
634 unsafe extern "C-unwind" fn(
635 frame: *mut ::core::ffi::c_void,
636 data: *const ::core::ffi::c_void,
637 ),
638 >,
639 );
640}
641unsafe extern "C-unwind" {
642 pub fn twz_rt_pre_main_hook() -> option_exit_code;
643}
644unsafe extern "C-unwind" {
645 pub fn twz_rt_post_main_hook();
646}
647unsafe extern "C-unwind" {
648 pub fn twz_rt_runtime_entry(
649 arg: *const runtime_info,
650 std_entry: ::core::option::Option<
651 unsafe extern "C-unwind" fn(arg1: basic_aux) -> basic_return,
652 >,
653 main: usize,
654 );
655}
656#[doc = " An open descriptor for a runtime file handle."]
657pub type descriptor = i32;
658#[doc = " Options for creating the file."]
659#[repr(C)]
660#[repr(align(16))]
661#[derive(Debug, Default, Copy, Clone)]
662pub struct create_options {
663 #[doc = " Object ID to bind the name to, optional. 0 if not present."]
664 pub id: objid,
665 #[doc = " The kind of open/create operation. See CREATE_KIND_*."]
666 pub kind: u8,
667}
668#[allow(clippy::unnecessary_operation, clippy::identity_op)]
669const _: () = {
670 ["Size of create_options"][::core::mem::size_of::<create_options>() - 32usize];
671 ["Alignment of create_options"][::core::mem::align_of::<create_options>() - 16usize];
672 ["Offset of field: create_options::id"][::core::mem::offset_of!(create_options, id) - 0usize];
673 ["Offset of field: create_options::kind"]
674 [::core::mem::offset_of!(create_options, kind) - 16usize];
675};
676pub const NAME_DATA_MAX: usize = 2048;
677#[doc = " Information for opening a file."]
678#[repr(C)]
679#[repr(align(16))]
680#[derive(Debug, Copy, Clone)]
681pub struct open_info {
682 #[doc = " Creation options"]
683 pub create: create_options,
684 #[doc = " Operation flags"]
685 pub flags: u32,
686 #[doc = " Length of file name in bytes."]
687 pub len: usize,
688 pub name: [u8; 2048usize],
689}
690#[allow(clippy::unnecessary_operation, clippy::identity_op)]
691const _: () = {
692 ["Size of open_info"][::core::mem::size_of::<open_info>() - 2096usize];
693 ["Alignment of open_info"][::core::mem::align_of::<open_info>() - 16usize];
694 ["Offset of field: open_info::create"][::core::mem::offset_of!(open_info, create) - 0usize];
695 ["Offset of field: open_info::flags"][::core::mem::offset_of!(open_info, flags) - 32usize];
696 ["Offset of field: open_info::len"][::core::mem::offset_of!(open_info, len) - 40usize];
697 ["Offset of field: open_info::name"][::core::mem::offset_of!(open_info, name) - 48usize];
698};
699impl Default for open_info {
700 fn default() -> Self {
701 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
702 unsafe {
703 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
704 s.assume_init()
705 }
706 }
707}
708#[doc = " Open the file only if it already exists."]
709pub const CREATE_KIND_EXISTING: u8 = 0;
710#[doc = " Open only if it doesn't exist, and create it."]
711pub const CREATE_KIND_NEW: u8 = 1;
712#[doc = " Open if it already exists, or create it if it doesn't."]
713pub const CREATE_KIND_EITHER: u8 = 2;
714#[doc = " Open the file with read access."]
715pub const OPEN_FLAG_READ: u32 = 1;
716#[doc = " Open the file with write access."]
717pub const OPEN_FLAG_WRITE: u32 = 2;
718#[doc = " Truncate the file on open. Requires write access."]
719pub const OPEN_FLAG_TRUNCATE: u32 = 4;
720#[doc = " Always use the end of the file as the position."]
721pub const OPEN_FLAG_TAIL: u32 = 8;
722#[doc = " If the file is a symlink, open the link instead of the target."]
723pub const OPEN_FLAG_SYMLINK: u32 = 16;
724#[doc = " Result of open call."]
725#[repr(C)]
726#[derive(Debug, Default, Copy, Clone)]
727pub struct open_result {
728 #[doc = " If error is Success, this contains a valid descriptor."]
729 pub fd: descriptor,
730 #[doc = " Error code, or success."]
731 pub err: twz_error,
732}
733#[allow(clippy::unnecessary_operation, clippy::identity_op)]
734const _: () = {
735 ["Size of open_result"][::core::mem::size_of::<open_result>() - 16usize];
736 ["Alignment of open_result"][::core::mem::align_of::<open_result>() - 8usize];
737 ["Offset of field: open_result::fd"][::core::mem::offset_of!(open_result, fd) - 0usize];
738 ["Offset of field: open_result::err"][::core::mem::offset_of!(open_result, err) - 8usize];
739};
740pub const open_kind_OpenKind_KernelConsole: open_kind = 0;
741pub const open_kind_OpenKind_Object: open_kind = 1;
742pub const open_kind_OpenKind_Path: open_kind = 2;
743pub const open_kind_OpenKind_Pipe: open_kind = 3;
744pub const open_kind_OpenKind_SocketConnect: open_kind = 4;
745pub const open_kind_OpenKind_SocketBind: open_kind = 5;
746pub const open_kind_OpenKind_SocketAccept: open_kind = 6;
747pub const open_kind_OpenKind_PtyServer: open_kind = 7;
748pub const open_kind_OpenKind_PtyClient: open_kind = 8;
749pub const open_kind_OpenKind_Compartment: open_kind = 9;
750pub type open_kind = ::core::ffi::c_uint;
751pub const addr_kind_AddrKind_Ipv4: addr_kind = 0;
752pub const addr_kind_AddrKind_Ipv6: addr_kind = 1;
753pub type addr_kind = ::core::ffi::c_uint;
754pub const prot_kind_ProtKind_Stream: prot_kind = 0;
755pub const prot_kind_ProtKind_Datagram: prot_kind = 1;
756pub type prot_kind = ::core::ffi::c_uint;
757#[repr(C)]
758#[derive(Copy, Clone)]
759pub union socket_address_addrs {
760 pub v4: [u8; 4usize],
761 pub v6: [u8; 16usize],
762}
763#[allow(clippy::unnecessary_operation, clippy::identity_op)]
764const _: () = {
765 ["Size of socket_address_addrs"][::core::mem::size_of::<socket_address_addrs>() - 16usize];
766 ["Alignment of socket_address_addrs"][::core::mem::align_of::<socket_address_addrs>() - 1usize];
767 ["Offset of field: socket_address_addrs::v4"]
768 [::core::mem::offset_of!(socket_address_addrs, v4) - 0usize];
769 ["Offset of field: socket_address_addrs::v6"]
770 [::core::mem::offset_of!(socket_address_addrs, v6) - 0usize];
771};
772impl Default for socket_address_addrs {
773 fn default() -> Self {
774 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
775 unsafe {
776 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
777 s.assume_init()
778 }
779 }
780}
781#[repr(C)]
782#[derive(Copy, Clone)]
783pub struct socket_address {
784 pub kind: addr_kind,
785 pub addr_octets: socket_address_addrs,
786 pub port: u16,
787 pub scope_id: u32,
788 pub flowinfo: u32,
789}
790#[allow(clippy::unnecessary_operation, clippy::identity_op)]
791const _: () = {
792 ["Size of socket_address"][::core::mem::size_of::<socket_address>() - 32usize];
793 ["Alignment of socket_address"][::core::mem::align_of::<socket_address>() - 4usize];
794 ["Offset of field: socket_address::kind"]
795 [::core::mem::offset_of!(socket_address, kind) - 0usize];
796 ["Offset of field: socket_address::addr_octets"]
797 [::core::mem::offset_of!(socket_address, addr_octets) - 4usize];
798 ["Offset of field: socket_address::port"]
799 [::core::mem::offset_of!(socket_address, port) - 20usize];
800 ["Offset of field: socket_address::scope_id"]
801 [::core::mem::offset_of!(socket_address, scope_id) - 24usize];
802 ["Offset of field: socket_address::flowinfo"]
803 [::core::mem::offset_of!(socket_address, flowinfo) - 28usize];
804};
805impl Default for socket_address {
806 fn default() -> Self {
807 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
808 unsafe {
809 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
810 s.assume_init()
811 }
812 }
813}
814#[repr(C)]
815#[derive(Copy, Clone)]
816pub struct socket_bind_info {
817 pub addr: socket_address,
818 pub prot: prot_kind,
819}
820#[allow(clippy::unnecessary_operation, clippy::identity_op)]
821const _: () = {
822 ["Size of socket_bind_info"][::core::mem::size_of::<socket_bind_info>() - 36usize];
823 ["Alignment of socket_bind_info"][::core::mem::align_of::<socket_bind_info>() - 4usize];
824 ["Offset of field: socket_bind_info::addr"]
825 [::core::mem::offset_of!(socket_bind_info, addr) - 0usize];
826 ["Offset of field: socket_bind_info::prot"]
827 [::core::mem::offset_of!(socket_bind_info, prot) - 32usize];
828};
829impl Default for socket_bind_info {
830 fn default() -> Self {
831 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
832 unsafe {
833 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
834 s.assume_init()
835 }
836 }
837}
838#[repr(C)]
839#[repr(align(16))]
840#[derive(Debug, Default, Copy, Clone)]
841pub struct object_bind_info {
842 pub id: objid,
843}
844#[allow(clippy::unnecessary_operation, clippy::identity_op)]
845const _: () = {
846 ["Size of object_bind_info"][::core::mem::size_of::<object_bind_info>() - 16usize];
847 ["Alignment of object_bind_info"][::core::mem::align_of::<object_bind_info>() - 16usize];
848 ["Offset of field: object_bind_info::id"]
849 [::core::mem::offset_of!(object_bind_info, id) - 0usize];
850};
851unsafe extern "C-unwind" {
852 #[doc = " Open a non-named file. The value pointed to by bind_info is dependent on the kind specified in the first\n argument. For pipe, bind_info is ignored. For Socket* kinds, bind_info points to a socket_address."]
853 pub fn twz_rt_fd_open(
854 kind: open_kind,
855 flags: u32,
856 bind_info: *mut ::core::ffi::c_void,
857 bind_info_len: usize,
858 ) -> open_result;
859}
860unsafe extern "C-unwind" {
861 #[doc = " Reopen a file descriptor with a new anon binding. The anon_kind remains unchanged. The value pointed to by bind_info is dependent on the kind specified in the first\n argument. For pipe, bind_info is ignored. For Socket* kinds, bind_info points to a socket_address."]
862 pub fn twz_rt_fd_reopen(
863 fd: descriptor,
864 kind: open_kind,
865 flags: u32,
866 bind_info: *mut ::core::ffi::c_void,
867 bind_info_len: usize,
868 ) -> twz_error;
869}
870unsafe extern "C-unwind" {
871 #[doc = " Close a file descriptor. If the file descriptor is invalid\n or already closed, this function does nothing."]
872 pub fn twz_rt_fd_close(fd: descriptor);
873}
874#[doc = " Flags a descriptor can have."]
875pub type fd_flags = u32;
876#[doc = " This file descriptor is a terminal."]
877pub const FD_IS_TERMINAL: fd_flags = 1;
878#[doc = " Regular file"]
879pub const fd_kind_FdKind_Regular: fd_kind = 0;
880#[doc = " Directory"]
881pub const fd_kind_FdKind_Directory: fd_kind = 1;
882#[doc = " Symbolic link"]
883pub const fd_kind_FdKind_SymLink: fd_kind = 2;
884#[doc = " Symbolic link"]
885pub const fd_kind_FdKind_Socket: fd_kind = 3;
886#[doc = " Symbolic link"]
887pub const fd_kind_FdKind_Pipe: fd_kind = 4;
888#[doc = " Symbolic link"]
889pub const fd_kind_FdKind_Pty: fd_kind = 5;
890#[doc = " Symbolic link"]
891pub const fd_kind_FdKind_Compartment: fd_kind = 6;
892#[doc = " Kinds of underlying fd objects"]
893pub type fd_kind = ::core::ffi::c_uint;
894#[doc = " Information about a file descriptor."]
895#[repr(C)]
896#[repr(align(16))]
897#[derive(Debug, Copy, Clone)]
898pub struct fd_info {
899 #[doc = " Underlying root objid."]
900 pub id: objid,
901 #[doc = " Length of underlying object, or 0 if undefined."]
902 pub len: u64,
903 #[doc = " Flags for the descriptor."]
904 pub flags: fd_flags,
905 #[doc = " Underlying fd kind"]
906 pub kind: fd_kind,
907 pub created: duration,
908 pub accessed: duration,
909 pub modified: duration,
910 pub unix_mode: u32,
911}
912#[allow(clippy::unnecessary_operation, clippy::identity_op)]
913const _: () = {
914 ["Size of fd_info"][::core::mem::size_of::<fd_info>() - 96usize];
915 ["Alignment of fd_info"][::core::mem::align_of::<fd_info>() - 16usize];
916 ["Offset of field: fd_info::id"][::core::mem::offset_of!(fd_info, id) - 0usize];
917 ["Offset of field: fd_info::len"][::core::mem::offset_of!(fd_info, len) - 16usize];
918 ["Offset of field: fd_info::flags"][::core::mem::offset_of!(fd_info, flags) - 24usize];
919 ["Offset of field: fd_info::kind"][::core::mem::offset_of!(fd_info, kind) - 28usize];
920 ["Offset of field: fd_info::created"][::core::mem::offset_of!(fd_info, created) - 32usize];
921 ["Offset of field: fd_info::accessed"][::core::mem::offset_of!(fd_info, accessed) - 48usize];
922 ["Offset of field: fd_info::modified"][::core::mem::offset_of!(fd_info, modified) - 64usize];
923 ["Offset of field: fd_info::unix_mode"][::core::mem::offset_of!(fd_info, unix_mode) - 80usize];
924};
925impl Default for fd_info {
926 fn default() -> Self {
927 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
928 unsafe {
929 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
930 s.assume_init()
931 }
932 }
933}
934unsafe extern "C-unwind" {
935 #[doc = " Get information about a descriptor. If this returns true, the fd was valid\n and the data pointed to by info is filled with fd_info data."]
936 pub fn twz_rt_fd_get_info(fd: descriptor, info: *mut fd_info) -> bool;
937}
938#[doc = " Commands for descriptors."]
939pub type fd_cmd = u32;
940#[doc = " Duplicate this descriptor. The arg argument is ignored. The ret argument points to a descriptor."]
941pub const FD_CMD_DUP: fd_cmd = 0;
942#[doc = " Sync the underlying storage of the file descriptor."]
943pub const FD_CMD_SYNC: fd_cmd = 1;
944#[doc = " Truncate the underlying storage of the file descriptor. The arg argument points to a u64 length."]
945pub const FD_CMD_TRUNCATE: fd_cmd = 2;
946#[doc = " Close either the read or write end of a file descriptor. The arg points to a u32, the first bit of which indicates read-side, the second indicates write."]
947pub const FD_CMD_SHUTDOWN: fd_cmd = 3;
948unsafe extern "C-unwind" {
949 #[doc = " Perform a command on the descriptor. The arguments arg and ret are interpreted according to\n the command specified."]
950 pub fn twz_rt_fd_cmd(
951 fd: descriptor,
952 cmd: fd_cmd,
953 arg: *mut ::core::ffi::c_void,
954 ret: *mut ::core::ffi::c_void,
955 ) -> twz_error;
956}
957pub const BIND_DATA_MAX: usize = 4096;
958#[repr(C)]
959#[repr(align(16))]
960#[derive(Debug, Copy, Clone)]
961pub struct binding_info {
962 pub kind: open_kind,
963 pub fd: descriptor,
964 pub flags: fd_flags,
965 pub bind_len: u32,
966 pub bind_data: [u8; 4096usize],
967}
968#[allow(clippy::unnecessary_operation, clippy::identity_op)]
969const _: () = {
970 ["Size of binding_info"][::core::mem::size_of::<binding_info>() - 4112usize];
971 ["Alignment of binding_info"][::core::mem::align_of::<binding_info>() - 16usize];
972 ["Offset of field: binding_info::kind"][::core::mem::offset_of!(binding_info, kind) - 0usize];
973 ["Offset of field: binding_info::fd"][::core::mem::offset_of!(binding_info, fd) - 4usize];
974 ["Offset of field: binding_info::flags"][::core::mem::offset_of!(binding_info, flags) - 8usize];
975 ["Offset of field: binding_info::bind_len"]
976 [::core::mem::offset_of!(binding_info, bind_len) - 12usize];
977 ["Offset of field: binding_info::bind_data"]
978 [::core::mem::offset_of!(binding_info, bind_data) - 16usize];
979};
980impl Default for binding_info {
981 fn default() -> Self {
982 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
983 unsafe {
984 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
985 s.assume_init()
986 }
987 }
988}
989unsafe extern "C-unwind" {
990 pub fn twz_rt_fd_read_binds(binds: *mut binding_info, nr_binds: usize) -> usize;
991}
992#[repr(C)]
993#[repr(align(16))]
994#[derive(Debug, Copy, Clone)]
995pub struct name_entry {
996 pub info: fd_info,
997 pub name_len: u32,
998 pub linkname_len: u32,
999 pub name: [u8; 256usize],
1000}
1001#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1002const _: () = {
1003 ["Size of name_entry"][::core::mem::size_of::<name_entry>() - 368usize];
1004 ["Alignment of name_entry"][::core::mem::align_of::<name_entry>() - 16usize];
1005 ["Offset of field: name_entry::info"][::core::mem::offset_of!(name_entry, info) - 0usize];
1006 ["Offset of field: name_entry::name_len"]
1007 [::core::mem::offset_of!(name_entry, name_len) - 96usize];
1008 ["Offset of field: name_entry::linkname_len"]
1009 [::core::mem::offset_of!(name_entry, linkname_len) - 100usize];
1010 ["Offset of field: name_entry::name"][::core::mem::offset_of!(name_entry, name) - 104usize];
1011};
1012impl Default for name_entry {
1013 fn default() -> Self {
1014 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1015 unsafe {
1016 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1017 s.assume_init()
1018 }
1019 }
1020}
1021unsafe extern "C-unwind" {
1022 #[doc = " Enumerate sub-names in an fd (e.g. directory entries). The buf and len arguments form a &mut [name_entry] slice, and the off argument specifies how many names to skip for this read. The return value is the number of entries read, or\n 0 if at end of list."]
1023 pub fn twz_rt_fd_enumerate_names(
1024 fd: descriptor,
1025 buf: *mut name_entry,
1026 len: usize,
1027 off: usize,
1028 ) -> io_result;
1029}
1030unsafe extern "C-unwind" {
1031 #[doc = " Remove a name in the namespace."]
1032 pub fn twz_rt_fd_remove(name: *const ::core::ffi::c_char, name_len: usize) -> twz_error;
1033}
1034unsafe extern "C-unwind" {
1035 #[doc = " Create a new namespace."]
1036 pub fn twz_rt_fd_mkns(name: *const ::core::ffi::c_char, name_len: usize) -> twz_error;
1037}
1038unsafe extern "C-unwind" {
1039 #[doc = " Create a new symlink."]
1040 pub fn twz_rt_fd_symlink(
1041 name: *const ::core::ffi::c_char,
1042 name_len: usize,
1043 target: *const ::core::ffi::c_char,
1044 target_len: usize,
1045 ) -> twz_error;
1046}
1047unsafe extern "C-unwind" {
1048 #[doc = " Rename a name in the namespace."]
1049 pub fn twz_rt_fd_rename(
1050 old_name: *const ::core::ffi::c_char,
1051 old_name_len: usize,
1052 new_name: *const ::core::ffi::c_char,
1053 new_name_len: usize,
1054 ) -> twz_error;
1055}
1056unsafe extern "C-unwind" {
1057 #[doc = " Read symlink."]
1058 pub fn twz_rt_fd_readlink(
1059 name: *const ::core::ffi::c_char,
1060 name_len: usize,
1061 buf: *mut ::core::ffi::c_char,
1062 buf_len: usize,
1063 out_buf_len: *mut u64,
1064 ) -> twz_error;
1065}
1066pub const name_root_NameRoot_Root: name_root = 0;
1067pub const name_root_NameRoot_Home: name_root = 1;
1068pub const name_root_NameRoot_Current: name_root = 2;
1069pub const name_root_NameRoot_Temp: name_root = 3;
1070pub const name_root_NameRoot_Exe: name_root = 4;
1071pub type name_root = ::core::ffi::c_uint;
1072unsafe extern "C-unwind" {
1073 pub fn twz_rt_set_nameroot(
1074 root: name_root,
1075 path: *const ::core::ffi::c_char,
1076 path_len: usize,
1077 ) -> twz_error;
1078}
1079unsafe extern "C-unwind" {
1080 pub fn twz_rt_get_nameroot(
1081 root: name_root,
1082 path: *mut ::core::ffi::c_char,
1083 path_len: usize,
1084 ) -> io_result;
1085}
1086pub const name_resolver_NameResolver_Default: name_resolver = 0;
1087pub const name_resolver_NameResolver_Socket: name_resolver = 1;
1088pub type name_resolver = ::core::ffi::c_uint;
1089unsafe extern "C-unwind" {
1090 pub fn twz_rt_resolve_name(
1091 resolver: name_resolver,
1092 name: *const ::core::ffi::c_char,
1093 name_len: usize,
1094 ) -> objid_result;
1095}
1096unsafe extern "C-unwind" {
1097 pub fn twz_rt_canon_name(
1098 resolver: name_resolver,
1099 name: *const ::core::ffi::c_char,
1100 name_len: usize,
1101 out: *mut ::core::ffi::c_char,
1102 out_len: *mut usize,
1103 ) -> twz_error;
1104}
1105pub type exec_flags = u32;
1106#[repr(C)]
1107#[derive(Debug, Copy, Clone)]
1108pub struct exec_spawn_args {
1109 pub prog: *const ::core::ffi::c_char,
1110 pub args: *const *const ::core::ffi::c_char,
1111 pub env: *const *const ::core::ffi::c_char,
1112 pub fd_binds: *const binding_info,
1113 pub fd_bind_count: usize,
1114 pub flags: exec_flags,
1115}
1116#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1117const _: () = {
1118 ["Size of exec_spawn_args"][::core::mem::size_of::<exec_spawn_args>() - 48usize];
1119 ["Alignment of exec_spawn_args"][::core::mem::align_of::<exec_spawn_args>() - 8usize];
1120 ["Offset of field: exec_spawn_args::prog"]
1121 [::core::mem::offset_of!(exec_spawn_args, prog) - 0usize];
1122 ["Offset of field: exec_spawn_args::args"]
1123 [::core::mem::offset_of!(exec_spawn_args, args) - 8usize];
1124 ["Offset of field: exec_spawn_args::env"]
1125 [::core::mem::offset_of!(exec_spawn_args, env) - 16usize];
1126 ["Offset of field: exec_spawn_args::fd_binds"]
1127 [::core::mem::offset_of!(exec_spawn_args, fd_binds) - 24usize];
1128 ["Offset of field: exec_spawn_args::fd_bind_count"]
1129 [::core::mem::offset_of!(exec_spawn_args, fd_bind_count) - 32usize];
1130 ["Offset of field: exec_spawn_args::flags"]
1131 [::core::mem::offset_of!(exec_spawn_args, flags) - 40usize];
1132};
1133impl Default for exec_spawn_args {
1134 fn default() -> Self {
1135 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1136 unsafe {
1137 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1138 s.assume_init()
1139 }
1140 }
1141}
1142unsafe extern "C-unwind" {
1143 pub fn twz_rt_exec_spawn(args: *const exec_spawn_args) -> open_result;
1144}
1145#[doc = " Futex type, based on linux futex."]
1146pub type futex_word = u32;
1147unsafe extern "C-unwind" {
1148 #[doc = " If *ptr == expected, wait until signal, optionally timing out."]
1149 pub fn twz_rt_futex_wait(
1150 ptr: *mut futex_word,
1151 expected: futex_word,
1152 timeout: option_duration,
1153 ) -> twz_error;
1154}
1155unsafe extern "C-unwind" {
1156 #[doc = " Wake up up to max threads waiting on ptr. If max is set to FUTEX_WAKE_ALL, wake all threads."]
1157 pub fn twz_rt_futex_wake(ptr: *mut futex_word, max: i64) -> twz_error;
1158}
1159#[doc = " Wake all threads instead of a maximum number"]
1160pub const FUTEX_WAKE_ALL: i64 = -1;
1161unsafe extern "C-unwind" {
1162 #[doc = " Yield the thread now."]
1163 pub fn twz_rt_yield_now();
1164}
1165unsafe extern "C-unwind" {
1166 #[doc = " Set the name of the calling thread. Must be a C string."]
1167 pub fn twz_rt_set_name(name: *const ::core::ffi::c_char);
1168}
1169unsafe extern "C-unwind" {
1170 #[doc = " Get the name of the calling thread. A slice of length *len is filled, and *len is updated to\n contain the length actually used. The result is also a C string."]
1171 pub fn twz_rt_get_name(
1172 tcb: *const ::core::ffi::c_void,
1173 name: *mut ::core::ffi::c_char,
1174 len: *mut usize,
1175 );
1176}
1177unsafe extern "C-unwind" {
1178 #[doc = " Sleep the calling thread for specified duration."]
1179 pub fn twz_rt_sleep(dur: duration);
1180}
1181#[doc = " TLS index, module ID and offset."]
1182#[repr(C)]
1183#[derive(Debug, Default, Copy, Clone)]
1184pub struct tls_index {
1185 pub mod_id: usize,
1186 pub offset: usize,
1187}
1188#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1189const _: () = {
1190 ["Size of tls_index"][::core::mem::size_of::<tls_index>() - 16usize];
1191 ["Alignment of tls_index"][::core::mem::align_of::<tls_index>() - 8usize];
1192 ["Offset of field: tls_index::mod_id"][::core::mem::offset_of!(tls_index, mod_id) - 0usize];
1193 ["Offset of field: tls_index::offset"][::core::mem::offset_of!(tls_index, offset) - 8usize];
1194};
1195unsafe extern "C-unwind" {
1196 #[doc = " Resolve the TLS index and get back the TLS data pointer."]
1197 pub fn twz_rt_tls_get_addr(index: *mut tls_index) -> *mut ::core::ffi::c_void;
1198}
1199#[doc = " A TLS desc struct, with a resolver and value"]
1200#[repr(C)]
1201#[derive(Debug, Copy, Clone)]
1202pub struct tls_desc {
1203 #[doc = " Pointer to resolver"]
1204 pub resolver: *mut ::core::ffi::c_void,
1205 #[doc = " Value to pass to the resolver"]
1206 pub value: u64,
1207}
1208#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1209const _: () = {
1210 ["Size of tls_desc"][::core::mem::size_of::<tls_desc>() - 16usize];
1211 ["Alignment of tls_desc"][::core::mem::align_of::<tls_desc>() - 8usize];
1212 ["Offset of field: tls_desc::resolver"][::core::mem::offset_of!(tls_desc, resolver) - 0usize];
1213 ["Offset of field: tls_desc::value"][::core::mem::offset_of!(tls_desc, value) - 8usize];
1214};
1215impl Default for tls_desc {
1216 fn default() -> Self {
1217 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1218 unsafe {
1219 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1220 s.assume_init()
1221 }
1222 }
1223}
1224unsafe extern "C-unwind" {
1225 #[doc = " Resolver for tls_desc"]
1226 pub fn twz_rt_tls_desc_resolve(arg: *mut tls_desc) -> *mut ::core::ffi::c_void;
1227}
1228#[doc = " Runtime-internal ID of a thread"]
1229pub type thread_id = u32;
1230#[doc = " Arguments to spawn"]
1231#[repr(C)]
1232#[derive(Debug, Default, Copy, Clone)]
1233pub struct spawn_args {
1234 #[doc = " Size of stack to allocate"]
1235 pub stack_size: usize,
1236 #[doc = " Starting address"]
1237 pub start: usize,
1238 #[doc = " Starting argument"]
1239 pub arg: usize,
1240}
1241#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1242const _: () = {
1243 ["Size of spawn_args"][::core::mem::size_of::<spawn_args>() - 24usize];
1244 ["Alignment of spawn_args"][::core::mem::align_of::<spawn_args>() - 8usize];
1245 ["Offset of field: spawn_args::stack_size"]
1246 [::core::mem::offset_of!(spawn_args, stack_size) - 0usize];
1247 ["Offset of field: spawn_args::start"][::core::mem::offset_of!(spawn_args, start) - 8usize];
1248 ["Offset of field: spawn_args::arg"][::core::mem::offset_of!(spawn_args, arg) - 16usize];
1249};
1250#[doc = " Spawn result."]
1251#[repr(C)]
1252#[derive(Debug, Copy, Clone)]
1253pub struct spawn_result {
1254 #[doc = " Thread id, if err is set to Success."]
1255 pub id: thread_id,
1256 pub err: twz_error,
1257 pub tcb: *mut ::core::ffi::c_void,
1258}
1259#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1260const _: () = {
1261 ["Size of spawn_result"][::core::mem::size_of::<spawn_result>() - 24usize];
1262 ["Alignment of spawn_result"][::core::mem::align_of::<spawn_result>() - 8usize];
1263 ["Offset of field: spawn_result::id"][::core::mem::offset_of!(spawn_result, id) - 0usize];
1264 ["Offset of field: spawn_result::err"][::core::mem::offset_of!(spawn_result, err) - 8usize];
1265 ["Offset of field: spawn_result::tcb"][::core::mem::offset_of!(spawn_result, tcb) - 16usize];
1266};
1267impl Default for spawn_result {
1268 fn default() -> Self {
1269 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1270 unsafe {
1271 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1272 s.assume_init()
1273 }
1274 }
1275}
1276unsafe extern "C-unwind" {
1277 #[doc = " Sawn a thread. On success, that thread starts executing concurrently with this function's return."]
1278 pub fn twz_rt_spawn_thread(args: spawn_args) -> spawn_result;
1279}
1280unsafe extern "C-unwind" {
1281 #[doc = " Wait for a thread to exit, optionally timing out."]
1282 pub fn twz_rt_join_thread(id: thread_id, timeout: option_duration) -> twz_error;
1283}
1284#[repr(C)]
1285#[repr(align(16))]
1286#[derive(Debug, Copy, Clone)]
1287pub struct thread_info {
1288 pub id: thread_id,
1289 pub tcb: *mut ::core::ffi::c_void,
1290 pub objid: objid,
1291}
1292#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1293const _: () = {
1294 ["Size of thread_info"][::core::mem::size_of::<thread_info>() - 32usize];
1295 ["Alignment of thread_info"][::core::mem::align_of::<thread_info>() - 16usize];
1296 ["Offset of field: thread_info::id"][::core::mem::offset_of!(thread_info, id) - 0usize];
1297 ["Offset of field: thread_info::tcb"][::core::mem::offset_of!(thread_info, tcb) - 8usize];
1298 ["Offset of field: thread_info::objid"][::core::mem::offset_of!(thread_info, objid) - 16usize];
1299};
1300impl Default for thread_info {
1301 fn default() -> Self {
1302 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1303 unsafe {
1304 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1305 s.assume_init()
1306 }
1307 }
1308}
1309pub const TWZ_RT_THREAD_ID_SELF: thread_id = 4294967295;
1310unsafe extern "C-unwind" {
1311 pub fn twz_rt_get_thread_info(id: thread_id) -> thread_info;
1312}
1313#[doc = " Mapping flags"]
1314pub type map_flags = u32;
1315#[doc = " Object handle"]
1316#[repr(C)]
1317#[repr(align(16))]
1318#[derive(Debug, Copy, Clone)]
1319pub struct object_handle {
1320 #[doc = " ID for this handle"]
1321 pub id: objid,
1322 #[doc = " Pointer to per-runtime info. The first 64-bits of this data must be an atomic u64 value used for reference counting."]
1323 pub runtime_info: *mut ::core::ffi::c_void,
1324 #[doc = " Pointer to start of object data."]
1325 pub start: *mut ::core::ffi::c_void,
1326 #[doc = " Pointer to object meta struct."]
1327 pub meta: *mut ::core::ffi::c_void,
1328 #[doc = " Mapping flags"]
1329 pub map_flags: map_flags,
1330 #[doc = " Number of valid bytes after start pointer for this object handle, in multiples of of LEN_MUL"]
1331 pub valid_len: u32,
1332}
1333#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1334const _: () = {
1335 ["Size of object_handle"][::core::mem::size_of::<object_handle>() - 48usize];
1336 ["Alignment of object_handle"][::core::mem::align_of::<object_handle>() - 16usize];
1337 ["Offset of field: object_handle::id"][::core::mem::offset_of!(object_handle, id) - 0usize];
1338 ["Offset of field: object_handle::runtime_info"]
1339 [::core::mem::offset_of!(object_handle, runtime_info) - 16usize];
1340 ["Offset of field: object_handle::start"]
1341 [::core::mem::offset_of!(object_handle, start) - 24usize];
1342 ["Offset of field: object_handle::meta"]
1343 [::core::mem::offset_of!(object_handle, meta) - 32usize];
1344 ["Offset of field: object_handle::map_flags"]
1345 [::core::mem::offset_of!(object_handle, map_flags) - 40usize];
1346 ["Offset of field: object_handle::valid_len"]
1347 [::core::mem::offset_of!(object_handle, valid_len) - 44usize];
1348};
1349impl Default for object_handle {
1350 fn default() -> Self {
1351 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1352 unsafe {
1353 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1354 s.assume_init()
1355 }
1356 }
1357}
1358#[doc = " Multiplier to valid_len."]
1359pub const LEN_MUL: usize = 4096;
1360#[repr(C)]
1361#[repr(align(8))]
1362#[derive(Debug, Copy, Clone)]
1363pub struct fd_set {
1364 pub fds_bits: [__mlibc_uint8; 128usize],
1365}
1366#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1367const _: () = {
1368 ["Size of fd_set"][::core::mem::size_of::<fd_set>() - 128usize];
1369 ["Alignment of fd_set"][::core::mem::align_of::<fd_set>() - 8usize];
1370 ["Offset of field: fd_set::fds_bits"][::core::mem::offset_of!(fd_set, fds_bits) - 0usize];
1371};
1372impl Default for fd_set {
1373 fn default() -> Self {
1374 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1375 unsafe {
1376 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1377 s.assume_init()
1378 }
1379 }
1380}
1381pub type pid_t = ::core::ffi::c_int;
1382#[repr(C)]
1383#[derive(Copy, Clone)]
1384pub union sigval {
1385 pub sival_int: ::core::ffi::c_int,
1386 pub sival_ptr: *mut ::core::ffi::c_void,
1387}
1388#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1389const _: () = {
1390 ["Size of sigval"][::core::mem::size_of::<sigval>() - 8usize];
1391 ["Alignment of sigval"][::core::mem::align_of::<sigval>() - 8usize];
1392 ["Offset of field: sigval::sival_int"][::core::mem::offset_of!(sigval, sival_int) - 0usize];
1393 ["Offset of field: sigval::sival_ptr"][::core::mem::offset_of!(sigval, sival_ptr) - 0usize];
1394};
1395impl Default for sigval {
1396 fn default() -> Self {
1397 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1398 unsafe {
1399 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1400 s.assume_init()
1401 }
1402 }
1403}
1404#[repr(C)]
1405#[derive(Copy, Clone)]
1406pub struct sigevent {
1407 pub sigev_value: sigval,
1408 pub sigev_notify: ::core::ffi::c_int,
1409 pub sigev_signo: ::core::ffi::c_int,
1410 pub sigev_notify_function: ::core::option::Option<unsafe extern "C-unwind" fn(arg1: sigval)>,
1411 pub sigev_notify_attributes: *mut __mlibc_threadattr,
1412 pub sigev_notify_thread_id: pid_t,
1413}
1414#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1415const _: () = {
1416 ["Size of sigevent"][::core::mem::size_of::<sigevent>() - 40usize];
1417 ["Alignment of sigevent"][::core::mem::align_of::<sigevent>() - 8usize];
1418 ["Offset of field: sigevent::sigev_value"]
1419 [::core::mem::offset_of!(sigevent, sigev_value) - 0usize];
1420 ["Offset of field: sigevent::sigev_notify"]
1421 [::core::mem::offset_of!(sigevent, sigev_notify) - 8usize];
1422 ["Offset of field: sigevent::sigev_signo"]
1423 [::core::mem::offset_of!(sigevent, sigev_signo) - 12usize];
1424 ["Offset of field: sigevent::sigev_notify_function"]
1425 [::core::mem::offset_of!(sigevent, sigev_notify_function) - 16usize];
1426 ["Offset of field: sigevent::sigev_notify_attributes"]
1427 [::core::mem::offset_of!(sigevent, sigev_notify_attributes) - 24usize];
1428 ["Offset of field: sigevent::sigev_notify_thread_id"]
1429 [::core::mem::offset_of!(sigevent, sigev_notify_thread_id) - 32usize];
1430};
1431impl Default for sigevent {
1432 fn default() -> Self {
1433 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1434 unsafe {
1435 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1436 s.assume_init()
1437 }
1438 }
1439}
1440#[repr(C)]
1441#[derive(Debug, Default, Copy, Clone)]
1442pub struct sigset_t {
1443 pub __sig: [::core::ffi::c_ulong; 16usize],
1444}
1445#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1446const _: () = {
1447 ["Size of sigset_t"][::core::mem::size_of::<sigset_t>() - 128usize];
1448 ["Alignment of sigset_t"][::core::mem::align_of::<sigset_t>() - 8usize];
1449 ["Offset of field: sigset_t::__sig"][::core::mem::offset_of!(sigset_t, __sig) - 0usize];
1450};
1451pub type uid_t = ::core::ffi::c_uint;
1452pub type clock_t = ::core::ffi::c_long;
1453#[repr(C)]
1454#[derive(Copy, Clone)]
1455pub struct siginfo_t {
1456 pub si_signo: ::core::ffi::c_int,
1457 pub si_errno: ::core::ffi::c_int,
1458 pub si_code: ::core::ffi::c_int,
1459 pub __si_fields: siginfo_t__bindgen_ty_1,
1460}
1461#[repr(C)]
1462#[derive(Copy, Clone)]
1463pub union siginfo_t__bindgen_ty_1 {
1464 pub __pad: [::core::ffi::c_char; 112usize],
1465 pub __si_common: siginfo_t__bindgen_ty_1__bindgen_ty_1,
1466 pub __sigfault: siginfo_t__bindgen_ty_1__bindgen_ty_2,
1467 pub __sigpoll: siginfo_t__bindgen_ty_1__bindgen_ty_3,
1468 pub __sigsys: siginfo_t__bindgen_ty_1__bindgen_ty_4,
1469}
1470#[repr(C)]
1471#[derive(Copy, Clone)]
1472pub struct siginfo_t__bindgen_ty_1__bindgen_ty_1 {
1473 pub __first: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
1474 pub __second: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2,
1475}
1476#[repr(C)]
1477#[derive(Copy, Clone)]
1478pub union siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
1479 pub __piduid: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
1480 pub __timer: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2,
1481}
1482#[repr(C)]
1483#[derive(Debug, Default, Copy, Clone)]
1484pub struct siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
1485 pub si_pid: pid_t,
1486 pub si_uid: uid_t,
1487}
1488#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1489const _: () = {
1490 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1"]
1491 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>(
1492 ) - 8usize];
1493 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1"]
1494 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>(
1495 ) - 4usize];
1496 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1::si_pid"] [:: core :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 , si_pid) - 0usize] ;
1497 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1::si_uid"] [:: core :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 , si_uid) - 4usize] ;
1498};
1499#[repr(C)]
1500#[derive(Debug, Default, Copy, Clone)]
1501pub struct siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2 {
1502 pub si_timerid: ::core::ffi::c_int,
1503 pub si_overrun: ::core::ffi::c_int,
1504}
1505#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1506const _: () = {
1507 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2"]
1508 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2>(
1509 ) - 8usize];
1510 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2"]
1511 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2>(
1512 ) - 4usize];
1513 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2::si_timerid"] [:: core :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2 , si_timerid) - 0usize] ;
1514 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2::si_overrun"] [:: core :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2 , si_overrun) - 4usize] ;
1515};
1516#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1517const _: () = {
1518 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1"]
1519 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>() - 8usize];
1520 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1"]
1521 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>() - 4usize];
1522 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1::__piduid"][::core::mem::offset_of!(
1523 siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
1524 __piduid
1525 ) - 0usize];
1526 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1::__timer"][::core::mem::offset_of!(
1527 siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
1528 __timer
1529 ) - 0usize];
1530};
1531impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
1532 fn default() -> Self {
1533 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1534 unsafe {
1535 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1536 s.assume_init()
1537 }
1538 }
1539}
1540#[repr(C)]
1541#[derive(Copy, Clone)]
1542pub union siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2 {
1543 pub si_value: sigval,
1544 pub __sigchld: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1,
1545}
1546#[repr(C)]
1547#[derive(Debug, Default, Copy, Clone)]
1548pub struct siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 {
1549 pub si_status: ::core::ffi::c_int,
1550 pub si_utime: clock_t,
1551 pub si_stime: clock_t,
1552}
1553#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1554const _: () = {
1555 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1"]
1556 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1>(
1557 ) - 24usize];
1558 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1"]
1559 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1>(
1560 ) - 8usize];
1561 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1::si_status"] [:: core :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 , si_status) - 0usize] ;
1562 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1::si_utime"] [:: core :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 , si_utime) - 8usize] ;
1563 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1::si_stime"] [:: core :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 , si_stime) - 16usize] ;
1564};
1565#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1566const _: () = {
1567 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2"]
1568 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2>() - 24usize];
1569 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2"]
1570 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2>() - 8usize];
1571 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2::si_value"][::core::mem::offset_of!(
1572 siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2,
1573 si_value
1574 ) - 0usize];
1575 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2::__sigchld"][::core::mem::offset_of!(
1576 siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2,
1577 __sigchld
1578 ) - 0usize];
1579};
1580impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_1__bindgen_ty_2 {
1581 fn default() -> Self {
1582 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1583 unsafe {
1584 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1585 s.assume_init()
1586 }
1587 }
1588}
1589#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1590const _: () = {
1591 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_1"]
1592 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1>() - 32usize];
1593 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_1"]
1594 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_1>() - 8usize];
1595 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1::__first"]
1596 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_1, __first) - 0usize];
1597 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1::__second"]
1598 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_1, __second) - 8usize];
1599};
1600impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_1 {
1601 fn default() -> Self {
1602 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1603 unsafe {
1604 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1605 s.assume_init()
1606 }
1607 }
1608}
1609#[repr(C)]
1610#[derive(Copy, Clone)]
1611pub struct siginfo_t__bindgen_ty_1__bindgen_ty_2 {
1612 pub si_addr: *mut ::core::ffi::c_void,
1613 pub si_addr_lsb: ::core::ffi::c_short,
1614 pub __first: siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1,
1615}
1616#[repr(C)]
1617#[derive(Copy, Clone)]
1618pub union siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 {
1619 pub __addr_bnd: siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1,
1620 pub si_pkey: ::core::ffi::c_uint,
1621}
1622#[repr(C)]
1623#[derive(Debug, Copy, Clone)]
1624pub struct siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1 {
1625 pub si_lower: *mut ::core::ffi::c_void,
1626 pub si_upper: *mut ::core::ffi::c_void,
1627}
1628#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1629const _: () = {
1630 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1"]
1631 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1>(
1632 ) - 16usize];
1633 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1"]
1634 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1>(
1635 ) - 8usize];
1636 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1::si_lower"] [:: core :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1 , si_lower) - 0usize] ;
1637 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1::si_upper"] [:: core :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1 , si_upper) - 8usize] ;
1638};
1639impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1__bindgen_ty_1 {
1640 fn default() -> Self {
1641 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1642 unsafe {
1643 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1644 s.assume_init()
1645 }
1646 }
1647}
1648#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1649const _: () = {
1650 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1"]
1651 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1>() - 16usize];
1652 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1"]
1653 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1>() - 8usize];
1654 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1::__addr_bnd"][::core::mem::offset_of!(
1655 siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1,
1656 __addr_bnd
1657 )
1658 - 0usize];
1659 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1::si_pkey"][::core::mem::offset_of!(
1660 siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1,
1661 si_pkey
1662 ) - 0usize];
1663};
1664impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 {
1665 fn default() -> Self {
1666 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1667 unsafe {
1668 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1669 s.assume_init()
1670 }
1671 }
1672}
1673#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1674const _: () = {
1675 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_2"]
1676 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_2>() - 32usize];
1677 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_2"]
1678 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_2>() - 8usize];
1679 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_2::si_addr"]
1680 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_2, si_addr) - 0usize];
1681 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_2::si_addr_lsb"]
1682 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_2, si_addr_lsb) - 8usize];
1683 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_2::__first"]
1684 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_2, __first) - 16usize];
1685};
1686impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_2 {
1687 fn default() -> Self {
1688 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1689 unsafe {
1690 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1691 s.assume_init()
1692 }
1693 }
1694}
1695#[repr(C)]
1696#[derive(Debug, Default, Copy, Clone)]
1697pub struct siginfo_t__bindgen_ty_1__bindgen_ty_3 {
1698 pub si_band: ::core::ffi::c_long,
1699 pub si_fd: ::core::ffi::c_int,
1700}
1701#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1702const _: () = {
1703 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_3"]
1704 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_3>() - 16usize];
1705 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_3"]
1706 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_3>() - 8usize];
1707 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_3::si_band"]
1708 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_3, si_band) - 0usize];
1709 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_3::si_fd"]
1710 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_3, si_fd) - 8usize];
1711};
1712#[repr(C)]
1713#[derive(Debug, Copy, Clone)]
1714pub struct siginfo_t__bindgen_ty_1__bindgen_ty_4 {
1715 pub si_call_addr: *mut ::core::ffi::c_void,
1716 pub si_syscall: ::core::ffi::c_int,
1717 pub si_arch: ::core::ffi::c_uint,
1718}
1719#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1720const _: () = {
1721 ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_4"]
1722 [::core::mem::size_of::<siginfo_t__bindgen_ty_1__bindgen_ty_4>() - 16usize];
1723 ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_4"]
1724 [::core::mem::align_of::<siginfo_t__bindgen_ty_1__bindgen_ty_4>() - 8usize];
1725 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_4::si_call_addr"]
1726 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_4, si_call_addr) - 0usize];
1727 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_4::si_syscall"]
1728 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_4, si_syscall) - 8usize];
1729 ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_4::si_arch"]
1730 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_4, si_arch) - 12usize];
1731};
1732impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_4 {
1733 fn default() -> Self {
1734 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1735 unsafe {
1736 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1737 s.assume_init()
1738 }
1739 }
1740}
1741#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1742const _: () = {
1743 ["Size of siginfo_t__bindgen_ty_1"]
1744 [::core::mem::size_of::<siginfo_t__bindgen_ty_1>() - 112usize];
1745 ["Alignment of siginfo_t__bindgen_ty_1"]
1746 [::core::mem::align_of::<siginfo_t__bindgen_ty_1>() - 8usize];
1747 ["Offset of field: siginfo_t__bindgen_ty_1::__pad"]
1748 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1, __pad) - 0usize];
1749 ["Offset of field: siginfo_t__bindgen_ty_1::__si_common"]
1750 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1, __si_common) - 0usize];
1751 ["Offset of field: siginfo_t__bindgen_ty_1::__sigfault"]
1752 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1, __sigfault) - 0usize];
1753 ["Offset of field: siginfo_t__bindgen_ty_1::__sigpoll"]
1754 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1, __sigpoll) - 0usize];
1755 ["Offset of field: siginfo_t__bindgen_ty_1::__sigsys"]
1756 [::core::mem::offset_of!(siginfo_t__bindgen_ty_1, __sigsys) - 0usize];
1757};
1758impl Default for siginfo_t__bindgen_ty_1 {
1759 fn default() -> Self {
1760 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1761 unsafe {
1762 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1763 s.assume_init()
1764 }
1765 }
1766}
1767#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1768const _: () = {
1769 ["Size of siginfo_t"][::core::mem::size_of::<siginfo_t>() - 128usize];
1770 ["Alignment of siginfo_t"][::core::mem::align_of::<siginfo_t>() - 8usize];
1771 ["Offset of field: siginfo_t::si_signo"][::core::mem::offset_of!(siginfo_t, si_signo) - 0usize];
1772 ["Offset of field: siginfo_t::si_errno"][::core::mem::offset_of!(siginfo_t, si_errno) - 4usize];
1773 ["Offset of field: siginfo_t::si_code"][::core::mem::offset_of!(siginfo_t, si_code) - 8usize];
1774 ["Offset of field: siginfo_t::__si_fields"]
1775 [::core::mem::offset_of!(siginfo_t, __si_fields) - 16usize];
1776};
1777impl Default for siginfo_t {
1778 fn default() -> Self {
1779 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1780 unsafe {
1781 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1782 s.assume_init()
1783 }
1784 }
1785}
1786pub type __sighandler =
1787 ::core::option::Option<unsafe extern "C-unwind" fn(arg1: ::core::ffi::c_int)>;
1788#[repr(C)]
1789#[derive(Debug, Copy, Clone)]
1790pub struct __stack {
1791 pub ss_sp: *mut ::core::ffi::c_void,
1792 pub ss_flags: ::core::ffi::c_int,
1793 pub ss_size: usize,
1794}
1795#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1796const _: () = {
1797 ["Size of __stack"][::core::mem::size_of::<__stack>() - 24usize];
1798 ["Alignment of __stack"][::core::mem::align_of::<__stack>() - 8usize];
1799 ["Offset of field: __stack::ss_sp"][::core::mem::offset_of!(__stack, ss_sp) - 0usize];
1800 ["Offset of field: __stack::ss_flags"][::core::mem::offset_of!(__stack, ss_flags) - 8usize];
1801 ["Offset of field: __stack::ss_size"][::core::mem::offset_of!(__stack, ss_size) - 16usize];
1802};
1803impl Default for __stack {
1804 fn default() -> Self {
1805 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1806 unsafe {
1807 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1808 s.assume_init()
1809 }
1810 }
1811}
1812pub type stack_t = __stack;
1813pub type clockid_t = ::core::ffi::c_int;
1814pub type __cpu_mask = ::core::ffi::c_ulong;
1815#[repr(C)]
1816#[derive(Debug, Default, Copy, Clone)]
1817pub struct cpu_set_t {
1818 pub __bits: [__cpu_mask; 16usize],
1819}
1820#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1821const _: () = {
1822 ["Size of cpu_set_t"][::core::mem::size_of::<cpu_set_t>() - 128usize];
1823 ["Alignment of cpu_set_t"][::core::mem::align_of::<cpu_set_t>() - 8usize];
1824 ["Offset of field: cpu_set_t::__bits"][::core::mem::offset_of!(cpu_set_t, __bits) - 0usize];
1825};
1826unsafe extern "C-unwind" {
1827 pub fn sigemptyset(__sigset: *mut sigset_t) -> ::core::ffi::c_int;
1828}
1829unsafe extern "C-unwind" {
1830 pub fn sigfillset(__sigset: *mut sigset_t) -> ::core::ffi::c_int;
1831}
1832unsafe extern "C-unwind" {
1833 pub fn sigaddset(__sigset: *mut sigset_t, __sig: ::core::ffi::c_int) -> ::core::ffi::c_int;
1834}
1835unsafe extern "C-unwind" {
1836 pub fn sigdelset(__sigset: *mut sigset_t, __sig: ::core::ffi::c_int) -> ::core::ffi::c_int;
1837}
1838unsafe extern "C-unwind" {
1839 pub fn sigismember(__sigset: *const sigset_t, __sig: ::core::ffi::c_int) -> ::core::ffi::c_int;
1840}
1841#[repr(C)]
1842#[derive(Debug, Default, Copy, Clone)]
1843pub struct __mlibc_sched_param {
1844 pub __sched_priority: ::core::ffi::c_int,
1845}
1846#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1847const _: () = {
1848 ["Size of __mlibc_sched_param"][::core::mem::size_of::<__mlibc_sched_param>() - 4usize];
1849 ["Alignment of __mlibc_sched_param"][::core::mem::align_of::<__mlibc_sched_param>() - 4usize];
1850 ["Offset of field: __mlibc_sched_param::__sched_priority"]
1851 [::core::mem::offset_of!(__mlibc_sched_param, __sched_priority) - 0usize];
1852};
1853#[repr(C)]
1854#[derive(Debug, Copy, Clone)]
1855pub struct __mlibc_thread_data {
1856 _unused: [u8; 0],
1857}
1858#[repr(C)]
1859#[derive(Debug, Copy, Clone)]
1860pub struct __mlibc_threadattr {
1861 pub __mlibc_guardsize: usize,
1862 pub __mlibc_stacksize: usize,
1863 pub __mlibc_stackaddr: *mut ::core::ffi::c_void,
1864 pub __mlibc_detachstate: ::core::ffi::c_int,
1865 pub __mlibc_scope: ::core::ffi::c_int,
1866 pub __mlibc_inheritsched: ::core::ffi::c_int,
1867 pub __mlibc_schedparam: __mlibc_sched_param,
1868 pub __mlibc_schedpolicy: ::core::ffi::c_int,
1869 pub __mlibc_cpuset: *mut cpu_set_t,
1870 pub __mlibc_cpusetsize: usize,
1871 pub __mlibc_sigmask: sigset_t,
1872 pub __mlibc_sigmaskset: ::core::ffi::c_int,
1873}
1874#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1875const _: () = {
1876 ["Size of __mlibc_threadattr"][::core::mem::size_of::<__mlibc_threadattr>() - 200usize];
1877 ["Alignment of __mlibc_threadattr"][::core::mem::align_of::<__mlibc_threadattr>() - 8usize];
1878 ["Offset of field: __mlibc_threadattr::__mlibc_guardsize"]
1879 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_guardsize) - 0usize];
1880 ["Offset of field: __mlibc_threadattr::__mlibc_stacksize"]
1881 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_stacksize) - 8usize];
1882 ["Offset of field: __mlibc_threadattr::__mlibc_stackaddr"]
1883 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_stackaddr) - 16usize];
1884 ["Offset of field: __mlibc_threadattr::__mlibc_detachstate"]
1885 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_detachstate) - 24usize];
1886 ["Offset of field: __mlibc_threadattr::__mlibc_scope"]
1887 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_scope) - 28usize];
1888 ["Offset of field: __mlibc_threadattr::__mlibc_inheritsched"]
1889 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_inheritsched) - 32usize];
1890 ["Offset of field: __mlibc_threadattr::__mlibc_schedparam"]
1891 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_schedparam) - 36usize];
1892 ["Offset of field: __mlibc_threadattr::__mlibc_schedpolicy"]
1893 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_schedpolicy) - 40usize];
1894 ["Offset of field: __mlibc_threadattr::__mlibc_cpuset"]
1895 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_cpuset) - 48usize];
1896 ["Offset of field: __mlibc_threadattr::__mlibc_cpusetsize"]
1897 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_cpusetsize) - 56usize];
1898 ["Offset of field: __mlibc_threadattr::__mlibc_sigmask"]
1899 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_sigmask) - 64usize];
1900 ["Offset of field: __mlibc_threadattr::__mlibc_sigmaskset"]
1901 [::core::mem::offset_of!(__mlibc_threadattr, __mlibc_sigmaskset) - 192usize];
1902};
1903impl Default for __mlibc_threadattr {
1904 fn default() -> Self {
1905 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1906 unsafe {
1907 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1908 s.assume_init()
1909 }
1910 }
1911}
1912#[repr(C)]
1913#[derive(Debug, Default, Copy, Clone)]
1914pub struct __mlibc_mutex {
1915 pub __mlibc_state: ::core::ffi::c_uint,
1916 pub __mlibc_recursion: ::core::ffi::c_uint,
1917 pub __mlibc_flags: ::core::ffi::c_uint,
1918 pub __mlibc_prioceiling: ::core::ffi::c_int,
1919}
1920#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1921const _: () = {
1922 ["Size of __mlibc_mutex"][::core::mem::size_of::<__mlibc_mutex>() - 16usize];
1923 ["Alignment of __mlibc_mutex"][::core::mem::align_of::<__mlibc_mutex>() - 4usize];
1924 ["Offset of field: __mlibc_mutex::__mlibc_state"]
1925 [::core::mem::offset_of!(__mlibc_mutex, __mlibc_state) - 0usize];
1926 ["Offset of field: __mlibc_mutex::__mlibc_recursion"]
1927 [::core::mem::offset_of!(__mlibc_mutex, __mlibc_recursion) - 4usize];
1928 ["Offset of field: __mlibc_mutex::__mlibc_flags"]
1929 [::core::mem::offset_of!(__mlibc_mutex, __mlibc_flags) - 8usize];
1930 ["Offset of field: __mlibc_mutex::__mlibc_prioceiling"]
1931 [::core::mem::offset_of!(__mlibc_mutex, __mlibc_prioceiling) - 12usize];
1932};
1933#[repr(C)]
1934#[derive(Debug, Default, Copy, Clone)]
1935pub struct __mlibc_mutexattr {
1936 pub __mlibc_type: ::core::ffi::c_int,
1937 pub __mlibc_robust: ::core::ffi::c_int,
1938 pub __mlibc_protocol: ::core::ffi::c_int,
1939 pub __mlibc_pshared: ::core::ffi::c_int,
1940 pub __mlibc_prioceiling: ::core::ffi::c_int,
1941}
1942#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1943const _: () = {
1944 ["Size of __mlibc_mutexattr"][::core::mem::size_of::<__mlibc_mutexattr>() - 20usize];
1945 ["Alignment of __mlibc_mutexattr"][::core::mem::align_of::<__mlibc_mutexattr>() - 4usize];
1946 ["Offset of field: __mlibc_mutexattr::__mlibc_type"]
1947 [::core::mem::offset_of!(__mlibc_mutexattr, __mlibc_type) - 0usize];
1948 ["Offset of field: __mlibc_mutexattr::__mlibc_robust"]
1949 [::core::mem::offset_of!(__mlibc_mutexattr, __mlibc_robust) - 4usize];
1950 ["Offset of field: __mlibc_mutexattr::__mlibc_protocol"]
1951 [::core::mem::offset_of!(__mlibc_mutexattr, __mlibc_protocol) - 8usize];
1952 ["Offset of field: __mlibc_mutexattr::__mlibc_pshared"]
1953 [::core::mem::offset_of!(__mlibc_mutexattr, __mlibc_pshared) - 12usize];
1954 ["Offset of field: __mlibc_mutexattr::__mlibc_prioceiling"]
1955 [::core::mem::offset_of!(__mlibc_mutexattr, __mlibc_prioceiling) - 16usize];
1956};
1957#[repr(C)]
1958#[derive(Debug, Default, Copy, Clone)]
1959pub struct __mlibc_cond {
1960 pub __mlibc_seq: ::core::ffi::c_uint,
1961 pub __mlibc_flags: ::core::ffi::c_uint,
1962 pub __mlibc_clock: clockid_t,
1963}
1964#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1965const _: () = {
1966 ["Size of __mlibc_cond"][::core::mem::size_of::<__mlibc_cond>() - 12usize];
1967 ["Alignment of __mlibc_cond"][::core::mem::align_of::<__mlibc_cond>() - 4usize];
1968 ["Offset of field: __mlibc_cond::__mlibc_seq"]
1969 [::core::mem::offset_of!(__mlibc_cond, __mlibc_seq) - 0usize];
1970 ["Offset of field: __mlibc_cond::__mlibc_flags"]
1971 [::core::mem::offset_of!(__mlibc_cond, __mlibc_flags) - 4usize];
1972 ["Offset of field: __mlibc_cond::__mlibc_clock"]
1973 [::core::mem::offset_of!(__mlibc_cond, __mlibc_clock) - 8usize];
1974};
1975#[repr(C)]
1976#[derive(Debug, Default, Copy, Clone)]
1977pub struct __mlibc_condattr {
1978 pub __mlibc_pshared: ::core::ffi::c_int,
1979 pub __mlibc_clock: clockid_t,
1980}
1981#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1982const _: () = {
1983 ["Size of __mlibc_condattr"][::core::mem::size_of::<__mlibc_condattr>() - 8usize];
1984 ["Alignment of __mlibc_condattr"][::core::mem::align_of::<__mlibc_condattr>() - 4usize];
1985 ["Offset of field: __mlibc_condattr::__mlibc_pshared"]
1986 [::core::mem::offset_of!(__mlibc_condattr, __mlibc_pshared) - 0usize];
1987 ["Offset of field: __mlibc_condattr::__mlibc_clock"]
1988 [::core::mem::offset_of!(__mlibc_condattr, __mlibc_clock) - 4usize];
1989};
1990#[repr(C)]
1991#[derive(Debug, Default, Copy, Clone)]
1992pub struct __mlibc_barrier {
1993 pub __mlibc_waiting: ::core::ffi::c_uint,
1994 pub __mlibc_inside: ::core::ffi::c_uint,
1995 pub __mlibc_count: ::core::ffi::c_uint,
1996 pub __mlibc_seq: ::core::ffi::c_uint,
1997 pub __mlibc_flags: ::core::ffi::c_uint,
1998}
1999#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2000const _: () = {
2001 ["Size of __mlibc_barrier"][::core::mem::size_of::<__mlibc_barrier>() - 20usize];
2002 ["Alignment of __mlibc_barrier"][::core::mem::align_of::<__mlibc_barrier>() - 4usize];
2003 ["Offset of field: __mlibc_barrier::__mlibc_waiting"]
2004 [::core::mem::offset_of!(__mlibc_barrier, __mlibc_waiting) - 0usize];
2005 ["Offset of field: __mlibc_barrier::__mlibc_inside"]
2006 [::core::mem::offset_of!(__mlibc_barrier, __mlibc_inside) - 4usize];
2007 ["Offset of field: __mlibc_barrier::__mlibc_count"]
2008 [::core::mem::offset_of!(__mlibc_barrier, __mlibc_count) - 8usize];
2009 ["Offset of field: __mlibc_barrier::__mlibc_seq"]
2010 [::core::mem::offset_of!(__mlibc_barrier, __mlibc_seq) - 12usize];
2011 ["Offset of field: __mlibc_barrier::__mlibc_flags"]
2012 [::core::mem::offset_of!(__mlibc_barrier, __mlibc_flags) - 16usize];
2013};
2014#[repr(C)]
2015#[derive(Debug, Default, Copy, Clone)]
2016pub struct __mlibc_barrierattr_struct {
2017 pub __mlibc_pshared: ::core::ffi::c_int,
2018}
2019#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2020const _: () = {
2021 ["Size of __mlibc_barrierattr_struct"]
2022 [::core::mem::size_of::<__mlibc_barrierattr_struct>() - 4usize];
2023 ["Alignment of __mlibc_barrierattr_struct"]
2024 [::core::mem::align_of::<__mlibc_barrierattr_struct>() - 4usize];
2025 ["Offset of field: __mlibc_barrierattr_struct::__mlibc_pshared"]
2026 [::core::mem::offset_of!(__mlibc_barrierattr_struct, __mlibc_pshared) - 0usize];
2027};
2028#[repr(C)]
2029#[derive(Debug, Default, Copy, Clone)]
2030pub struct __mlibc_fair_rwlock {
2031 pub __mlibc_m: ::core::ffi::c_uint,
2032 pub __mlibc_rc: ::core::ffi::c_uint,
2033 pub __mlibc_flags: ::core::ffi::c_uint,
2034}
2035#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2036const _: () = {
2037 ["Size of __mlibc_fair_rwlock"][::core::mem::size_of::<__mlibc_fair_rwlock>() - 12usize];
2038 ["Alignment of __mlibc_fair_rwlock"][::core::mem::align_of::<__mlibc_fair_rwlock>() - 4usize];
2039 ["Offset of field: __mlibc_fair_rwlock::__mlibc_m"]
2040 [::core::mem::offset_of!(__mlibc_fair_rwlock, __mlibc_m) - 0usize];
2041 ["Offset of field: __mlibc_fair_rwlock::__mlibc_rc"]
2042 [::core::mem::offset_of!(__mlibc_fair_rwlock, __mlibc_rc) - 4usize];
2043 ["Offset of field: __mlibc_fair_rwlock::__mlibc_flags"]
2044 [::core::mem::offset_of!(__mlibc_fair_rwlock, __mlibc_flags) - 8usize];
2045};
2046#[repr(C)]
2047#[derive(Debug, Default, Copy, Clone)]
2048pub struct __mlibc_rwlockattr {
2049 pub __mlibc_pshared: ::core::ffi::c_int,
2050}
2051#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2052const _: () = {
2053 ["Size of __mlibc_rwlockattr"][::core::mem::size_of::<__mlibc_rwlockattr>() - 4usize];
2054 ["Alignment of __mlibc_rwlockattr"][::core::mem::align_of::<__mlibc_rwlockattr>() - 4usize];
2055 ["Offset of field: __mlibc_rwlockattr::__mlibc_pshared"]
2056 [::core::mem::offset_of!(__mlibc_rwlockattr, __mlibc_pshared) - 0usize];
2057};
2058#[repr(C)]
2059#[derive(Debug, Default, Copy, Clone)]
2060pub struct __mlibc_once {
2061 pub __mlibc_done: ::core::ffi::c_uint,
2062}
2063#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2064const _: () = {
2065 ["Size of __mlibc_once"][::core::mem::size_of::<__mlibc_once>() - 4usize];
2066 ["Alignment of __mlibc_once"][::core::mem::align_of::<__mlibc_once>() - 4usize];
2067 ["Offset of field: __mlibc_once::__mlibc_done"]
2068 [::core::mem::offset_of!(__mlibc_once, __mlibc_done) - 0usize];
2069};
2070#[repr(C)]
2071#[derive(Debug, Default, Copy, Clone)]
2072pub struct __mlibc_spinlock {
2073 pub __lock: ::core::ffi::c_uint,
2074}
2075#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2076const _: () = {
2077 ["Size of __mlibc_spinlock"][::core::mem::size_of::<__mlibc_spinlock>() - 4usize];
2078 ["Alignment of __mlibc_spinlock"][::core::mem::align_of::<__mlibc_spinlock>() - 4usize];
2079 ["Offset of field: __mlibc_spinlock::__lock"]
2080 [::core::mem::offset_of!(__mlibc_spinlock, __lock) - 0usize];
2081};
2082#[repr(C)]
2083#[derive(Copy, Clone)]
2084pub struct sigaction {
2085 pub __sa_handler: sigaction__bindgen_ty_1,
2086 pub sa_flags: ::core::ffi::c_ulong,
2087 pub sa_restorer: ::core::option::Option<unsafe extern "C-unwind" fn()>,
2088 pub sa_mask: sigset_t,
2089}
2090#[repr(C)]
2091#[derive(Copy, Clone)]
2092pub union sigaction__bindgen_ty_1 {
2093 pub sa_handler: ::core::option::Option<unsafe extern "C-unwind" fn(arg1: ::core::ffi::c_int)>,
2094 pub sa_sigaction: ::core::option::Option<
2095 unsafe extern "C-unwind" fn(
2096 arg1: ::core::ffi::c_int,
2097 arg2: *mut siginfo_t,
2098 arg3: *mut ::core::ffi::c_void,
2099 ),
2100 >,
2101}
2102#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2103const _: () = {
2104 ["Size of sigaction__bindgen_ty_1"][::core::mem::size_of::<sigaction__bindgen_ty_1>() - 8usize];
2105 ["Alignment of sigaction__bindgen_ty_1"]
2106 [::core::mem::align_of::<sigaction__bindgen_ty_1>() - 8usize];
2107 ["Offset of field: sigaction__bindgen_ty_1::sa_handler"]
2108 [::core::mem::offset_of!(sigaction__bindgen_ty_1, sa_handler) - 0usize];
2109 ["Offset of field: sigaction__bindgen_ty_1::sa_sigaction"]
2110 [::core::mem::offset_of!(sigaction__bindgen_ty_1, sa_sigaction) - 0usize];
2111};
2112impl Default for sigaction__bindgen_ty_1 {
2113 fn default() -> Self {
2114 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2115 unsafe {
2116 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2117 s.assume_init()
2118 }
2119 }
2120}
2121#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2122const _: () = {
2123 ["Size of sigaction"][::core::mem::size_of::<sigaction>() - 152usize];
2124 ["Alignment of sigaction"][::core::mem::align_of::<sigaction>() - 8usize];
2125 ["Offset of field: sigaction::__sa_handler"]
2126 [::core::mem::offset_of!(sigaction, __sa_handler) - 0usize];
2127 ["Offset of field: sigaction::sa_flags"][::core::mem::offset_of!(sigaction, sa_flags) - 8usize];
2128 ["Offset of field: sigaction::sa_restorer"]
2129 [::core::mem::offset_of!(sigaction, sa_restorer) - 16usize];
2130 ["Offset of field: sigaction::sa_mask"][::core::mem::offset_of!(sigaction, sa_mask) - 24usize];
2131};
2132impl Default for sigaction {
2133 fn default() -> Self {
2134 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2135 unsafe {
2136 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2137 s.assume_init()
2138 }
2139 }
2140}
2141#[repr(C)]
2142#[derive(Debug, Default, Copy, Clone)]
2143pub struct _fpxreg {
2144 pub significand: [::core::ffi::c_ushort; 4usize],
2145 pub exponent: ::core::ffi::c_ushort,
2146 pub __padding: [::core::ffi::c_ushort; 3usize],
2147}
2148#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2149const _: () = {
2150 ["Size of _fpxreg"][::core::mem::size_of::<_fpxreg>() - 16usize];
2151 ["Alignment of _fpxreg"][::core::mem::align_of::<_fpxreg>() - 2usize];
2152 ["Offset of field: _fpxreg::significand"]
2153 [::core::mem::offset_of!(_fpxreg, significand) - 0usize];
2154 ["Offset of field: _fpxreg::exponent"][::core::mem::offset_of!(_fpxreg, exponent) - 8usize];
2155 ["Offset of field: _fpxreg::__padding"][::core::mem::offset_of!(_fpxreg, __padding) - 10usize];
2156};
2157#[repr(C)]
2158#[derive(Debug, Default, Copy, Clone)]
2159pub struct _xmmreg {
2160 pub element: [__mlibc_uint32; 4usize],
2161}
2162#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2163const _: () = {
2164 ["Size of _xmmreg"][::core::mem::size_of::<_xmmreg>() - 16usize];
2165 ["Alignment of _xmmreg"][::core::mem::align_of::<_xmmreg>() - 4usize];
2166 ["Offset of field: _xmmreg::element"][::core::mem::offset_of!(_xmmreg, element) - 0usize];
2167};
2168#[repr(C)]
2169#[derive(Debug, Default, Copy, Clone)]
2170pub struct _fpstate {
2171 pub cwd: __mlibc_uint16,
2172 pub swd: __mlibc_uint16,
2173 pub ftw: __mlibc_uint16,
2174 pub fop: __mlibc_uint16,
2175 pub rip: __mlibc_uint64,
2176 pub rdp: __mlibc_uint64,
2177 pub mxcsr: __mlibc_uint32,
2178 pub mxcr_mask: __mlibc_uint32,
2179 pub _st: [_fpxreg; 8usize],
2180 pub _xmm: [_xmmreg; 16usize],
2181 pub __padding: [__mlibc_uint32; 24usize],
2182}
2183#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2184const _: () = {
2185 ["Size of _fpstate"][::core::mem::size_of::<_fpstate>() - 512usize];
2186 ["Alignment of _fpstate"][::core::mem::align_of::<_fpstate>() - 8usize];
2187 ["Offset of field: _fpstate::cwd"][::core::mem::offset_of!(_fpstate, cwd) - 0usize];
2188 ["Offset of field: _fpstate::swd"][::core::mem::offset_of!(_fpstate, swd) - 2usize];
2189 ["Offset of field: _fpstate::ftw"][::core::mem::offset_of!(_fpstate, ftw) - 4usize];
2190 ["Offset of field: _fpstate::fop"][::core::mem::offset_of!(_fpstate, fop) - 6usize];
2191 ["Offset of field: _fpstate::rip"][::core::mem::offset_of!(_fpstate, rip) - 8usize];
2192 ["Offset of field: _fpstate::rdp"][::core::mem::offset_of!(_fpstate, rdp) - 16usize];
2193 ["Offset of field: _fpstate::mxcsr"][::core::mem::offset_of!(_fpstate, mxcsr) - 24usize];
2194 ["Offset of field: _fpstate::mxcr_mask"]
2195 [::core::mem::offset_of!(_fpstate, mxcr_mask) - 28usize];
2196 ["Offset of field: _fpstate::_st"][::core::mem::offset_of!(_fpstate, _st) - 32usize];
2197 ["Offset of field: _fpstate::_xmm"][::core::mem::offset_of!(_fpstate, _xmm) - 160usize];
2198 ["Offset of field: _fpstate::__padding"]
2199 [::core::mem::offset_of!(_fpstate, __padding) - 416usize];
2200};
2201#[repr(C)]
2202#[derive(Debug, Copy, Clone)]
2203pub struct sigcontext {
2204 pub r8: ::core::ffi::c_ulong,
2205 pub r9: ::core::ffi::c_ulong,
2206 pub r10: ::core::ffi::c_ulong,
2207 pub r11: ::core::ffi::c_ulong,
2208 pub r12: ::core::ffi::c_ulong,
2209 pub r13: ::core::ffi::c_ulong,
2210 pub r14: ::core::ffi::c_ulong,
2211 pub r15: ::core::ffi::c_ulong,
2212 pub rdi: ::core::ffi::c_ulong,
2213 pub rsi: ::core::ffi::c_ulong,
2214 pub rbp: ::core::ffi::c_ulong,
2215 pub rbx: ::core::ffi::c_ulong,
2216 pub rdx: ::core::ffi::c_ulong,
2217 pub rax: ::core::ffi::c_ulong,
2218 pub rcx: ::core::ffi::c_ulong,
2219 pub rsp: ::core::ffi::c_ulong,
2220 pub rip: ::core::ffi::c_ulong,
2221 pub eflags: ::core::ffi::c_ulong,
2222 pub cs: ::core::ffi::c_ushort,
2223 pub gs: ::core::ffi::c_ushort,
2224 pub fs: ::core::ffi::c_ushort,
2225 pub ss: ::core::ffi::c_ushort,
2226 pub err: ::core::ffi::c_ulong,
2227 pub trapno: ::core::ffi::c_ulong,
2228 pub oldmask: ::core::ffi::c_ulong,
2229 pub cr2: ::core::ffi::c_ulong,
2230 pub fpstate: *mut _fpstate,
2231 pub __reserved1: [::core::ffi::c_ulong; 8usize],
2232}
2233#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2234const _: () = {
2235 ["Size of sigcontext"][::core::mem::size_of::<sigcontext>() - 256usize];
2236 ["Alignment of sigcontext"][::core::mem::align_of::<sigcontext>() - 8usize];
2237 ["Offset of field: sigcontext::r8"][::core::mem::offset_of!(sigcontext, r8) - 0usize];
2238 ["Offset of field: sigcontext::r9"][::core::mem::offset_of!(sigcontext, r9) - 8usize];
2239 ["Offset of field: sigcontext::r10"][::core::mem::offset_of!(sigcontext, r10) - 16usize];
2240 ["Offset of field: sigcontext::r11"][::core::mem::offset_of!(sigcontext, r11) - 24usize];
2241 ["Offset of field: sigcontext::r12"][::core::mem::offset_of!(sigcontext, r12) - 32usize];
2242 ["Offset of field: sigcontext::r13"][::core::mem::offset_of!(sigcontext, r13) - 40usize];
2243 ["Offset of field: sigcontext::r14"][::core::mem::offset_of!(sigcontext, r14) - 48usize];
2244 ["Offset of field: sigcontext::r15"][::core::mem::offset_of!(sigcontext, r15) - 56usize];
2245 ["Offset of field: sigcontext::rdi"][::core::mem::offset_of!(sigcontext, rdi) - 64usize];
2246 ["Offset of field: sigcontext::rsi"][::core::mem::offset_of!(sigcontext, rsi) - 72usize];
2247 ["Offset of field: sigcontext::rbp"][::core::mem::offset_of!(sigcontext, rbp) - 80usize];
2248 ["Offset of field: sigcontext::rbx"][::core::mem::offset_of!(sigcontext, rbx) - 88usize];
2249 ["Offset of field: sigcontext::rdx"][::core::mem::offset_of!(sigcontext, rdx) - 96usize];
2250 ["Offset of field: sigcontext::rax"][::core::mem::offset_of!(sigcontext, rax) - 104usize];
2251 ["Offset of field: sigcontext::rcx"][::core::mem::offset_of!(sigcontext, rcx) - 112usize];
2252 ["Offset of field: sigcontext::rsp"][::core::mem::offset_of!(sigcontext, rsp) - 120usize];
2253 ["Offset of field: sigcontext::rip"][::core::mem::offset_of!(sigcontext, rip) - 128usize];
2254 ["Offset of field: sigcontext::eflags"][::core::mem::offset_of!(sigcontext, eflags) - 136usize];
2255 ["Offset of field: sigcontext::cs"][::core::mem::offset_of!(sigcontext, cs) - 144usize];
2256 ["Offset of field: sigcontext::gs"][::core::mem::offset_of!(sigcontext, gs) - 146usize];
2257 ["Offset of field: sigcontext::fs"][::core::mem::offset_of!(sigcontext, fs) - 148usize];
2258 ["Offset of field: sigcontext::ss"][::core::mem::offset_of!(sigcontext, ss) - 150usize];
2259 ["Offset of field: sigcontext::err"][::core::mem::offset_of!(sigcontext, err) - 152usize];
2260 ["Offset of field: sigcontext::trapno"][::core::mem::offset_of!(sigcontext, trapno) - 160usize];
2261 ["Offset of field: sigcontext::oldmask"]
2262 [::core::mem::offset_of!(sigcontext, oldmask) - 168usize];
2263 ["Offset of field: sigcontext::cr2"][::core::mem::offset_of!(sigcontext, cr2) - 176usize];
2264 ["Offset of field: sigcontext::fpstate"]
2265 [::core::mem::offset_of!(sigcontext, fpstate) - 184usize];
2266 ["Offset of field: sigcontext::__reserved1"]
2267 [::core::mem::offset_of!(sigcontext, __reserved1) - 192usize];
2268};
2269impl Default for sigcontext {
2270 fn default() -> Self {
2271 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2272 unsafe {
2273 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2274 s.assume_init()
2275 }
2276 }
2277}
2278#[repr(C)]
2279#[derive(Debug, Copy, Clone)]
2280pub struct mcontext_t {
2281 pub gregs: [::core::ffi::c_ulong; 23usize],
2282 pub fpregs: *mut _fpstate,
2283 pub __reserved1: [::core::ffi::c_ulong; 8usize],
2284}
2285#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2286const _: () = {
2287 ["Size of mcontext_t"][::core::mem::size_of::<mcontext_t>() - 256usize];
2288 ["Alignment of mcontext_t"][::core::mem::align_of::<mcontext_t>() - 8usize];
2289 ["Offset of field: mcontext_t::gregs"][::core::mem::offset_of!(mcontext_t, gregs) - 0usize];
2290 ["Offset of field: mcontext_t::fpregs"][::core::mem::offset_of!(mcontext_t, fpregs) - 184usize];
2291 ["Offset of field: mcontext_t::__reserved1"]
2292 [::core::mem::offset_of!(mcontext_t, __reserved1) - 192usize];
2293};
2294impl Default for mcontext_t {
2295 fn default() -> Self {
2296 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2297 unsafe {
2298 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2299 s.assume_init()
2300 }
2301 }
2302}
2303#[repr(C)]
2304#[derive(Debug, Copy, Clone)]
2305pub struct __ucontext {
2306 pub uc_flags: ::core::ffi::c_ulong,
2307 pub uc_link: *mut __ucontext,
2308 pub uc_stack: stack_t,
2309 pub uc_mcontext: mcontext_t,
2310 pub uc_sigmask: sigset_t,
2311 pub __fpregs_mem: _fpstate,
2312 pub __ssp: [::core::ffi::c_ulong; 4usize],
2313}
2314#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2315const _: () = {
2316 ["Size of __ucontext"][::core::mem::size_of::<__ucontext>() - 968usize];
2317 ["Alignment of __ucontext"][::core::mem::align_of::<__ucontext>() - 8usize];
2318 ["Offset of field: __ucontext::uc_flags"]
2319 [::core::mem::offset_of!(__ucontext, uc_flags) - 0usize];
2320 ["Offset of field: __ucontext::uc_link"][::core::mem::offset_of!(__ucontext, uc_link) - 8usize];
2321 ["Offset of field: __ucontext::uc_stack"]
2322 [::core::mem::offset_of!(__ucontext, uc_stack) - 16usize];
2323 ["Offset of field: __ucontext::uc_mcontext"]
2324 [::core::mem::offset_of!(__ucontext, uc_mcontext) - 40usize];
2325 ["Offset of field: __ucontext::uc_sigmask"]
2326 [::core::mem::offset_of!(__ucontext, uc_sigmask) - 296usize];
2327 ["Offset of field: __ucontext::__fpregs_mem"]
2328 [::core::mem::offset_of!(__ucontext, __fpregs_mem) - 424usize];
2329 ["Offset of field: __ucontext::__ssp"][::core::mem::offset_of!(__ucontext, __ssp) - 936usize];
2330};
2331impl Default for __ucontext {
2332 fn default() -> Self {
2333 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2334 unsafe {
2335 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2336 s.assume_init()
2337 }
2338 }
2339}
2340pub type ucontext_t = __ucontext;
2341pub type time_t = ::core::ffi::c_long;
2342#[repr(C)]
2343#[derive(Debug, Default, Copy, Clone)]
2344pub struct timespec {
2345 pub tv_sec: time_t,
2346 pub tv_nsec: ::core::ffi::c_long,
2347}
2348#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2349const _: () = {
2350 ["Size of timespec"][::core::mem::size_of::<timespec>() - 16usize];
2351 ["Alignment of timespec"][::core::mem::align_of::<timespec>() - 8usize];
2352 ["Offset of field: timespec::tv_sec"][::core::mem::offset_of!(timespec, tv_sec) - 0usize];
2353 ["Offset of field: timespec::tv_nsec"][::core::mem::offset_of!(timespec, tv_nsec) - 8usize];
2354};
2355pub type suseconds_t = ::core::ffi::c_long;
2356#[repr(C)]
2357#[derive(Debug, Default, Copy, Clone)]
2358pub struct timeval {
2359 pub tv_sec: time_t,
2360 pub tv_usec: suseconds_t,
2361}
2362#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2363const _: () = {
2364 ["Size of timeval"][::core::mem::size_of::<timeval>() - 16usize];
2365 ["Alignment of timeval"][::core::mem::align_of::<timeval>() - 8usize];
2366 ["Offset of field: timeval::tv_sec"][::core::mem::offset_of!(timeval, tv_sec) - 0usize];
2367 ["Offset of field: timeval::tv_usec"][::core::mem::offset_of!(timeval, tv_usec) - 8usize];
2368};
2369pub type __fd_mask = ::core::ffi::c_long;
2370pub type fd_mask = __fd_mask;
2371unsafe extern "C-unwind" {
2372 pub fn __FD_CLR(__fd: ::core::ffi::c_int, __set: *mut fd_set);
2373}
2374unsafe extern "C-unwind" {
2375 pub fn __FD_ISSET(__fd: ::core::ffi::c_int, __set: *mut fd_set) -> ::core::ffi::c_int;
2376}
2377unsafe extern "C-unwind" {
2378 pub fn __FD_SET(__fd: ::core::ffi::c_int, __set: *mut fd_set);
2379}
2380unsafe extern "C-unwind" {
2381 pub fn __FD_ZERO(__set: *mut fd_set);
2382}
2383unsafe extern "C-unwind" {
2384 pub fn select(
2385 __nfds: ::core::ffi::c_int,
2386 __readfds: *mut fd_set,
2387 __writefds: *mut fd_set,
2388 __exceptfds: *mut fd_set,
2389 __timeout: *mut timeval,
2390 ) -> ::core::ffi::c_int;
2391}
2392unsafe extern "C-unwind" {
2393 pub fn pselect(
2394 __nfds: ::core::ffi::c_int,
2395 __readfds: *mut fd_set,
2396 __writefds: *mut fd_set,
2397 __exceptfds: *mut fd_set,
2398 __timeout: *const timespec,
2399 __sigmask: *const sigset_t,
2400 ) -> ::core::ffi::c_int;
2401}
2402pub type nfds_t = __mlibc_size;
2403#[repr(C)]
2404#[derive(Debug, Default, Copy, Clone)]
2405pub struct pollfd {
2406 pub fd: ::core::ffi::c_int,
2407 pub events: ::core::ffi::c_short,
2408 pub revents: ::core::ffi::c_short,
2409}
2410#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2411const _: () = {
2412 ["Size of pollfd"][::core::mem::size_of::<pollfd>() - 8usize];
2413 ["Alignment of pollfd"][::core::mem::align_of::<pollfd>() - 4usize];
2414 ["Offset of field: pollfd::fd"][::core::mem::offset_of!(pollfd, fd) - 0usize];
2415 ["Offset of field: pollfd::events"][::core::mem::offset_of!(pollfd, events) - 4usize];
2416 ["Offset of field: pollfd::revents"][::core::mem::offset_of!(pollfd, revents) - 6usize];
2417};
2418unsafe extern "C-unwind" {
2419 pub fn poll(
2420 __fds: *mut pollfd,
2421 __nfds: nfds_t,
2422 __timeout: ::core::ffi::c_int,
2423 ) -> ::core::ffi::c_int;
2424}
2425#[doc = " Type of whence values for seek."]
2426pub type whence = u32;
2427#[doc = " Flags for IO operations"]
2428pub type io_flags = u32;
2429#[doc = " Non-blocking behavior specified. If the operation would block, return io_result with error set to WouldBlock instead."]
2430pub const IO_NONBLOCKING: io_flags = 1;
2431#[doc = " Peek at the data without updating the internal position pointer or consuming any stream data."]
2432pub const IO_PEEK: io_flags = 2;
2433#[doc = " Wait for all the data to be ready."]
2434pub const IO_WAITALL: io_flags = 4;
2435#[doc = " Process out of band data, if supported."]
2436pub const IO_OOB: io_flags = 8;
2437#[doc = " Seek offset from start of file"]
2438pub const WHENCE_START: whence = 0;
2439#[doc = " Seek offset from end of file"]
2440pub const WHENCE_END: whence = 1;
2441#[doc = " Seek offset from current fd position"]
2442pub const WHENCE_CURRENT: whence = 2;
2443#[doc = " Optional offset. If value is FD_POS, use the file descriptor position."]
2444pub type optional_offset = i64;
2445pub const FD_POS: optional_offset = -1;
2446#[doc = " Context for I/O operations."]
2447#[repr(C)]
2448#[derive(Debug, Default, Copy, Clone)]
2449pub struct io_ctx {
2450 pub flags: io_flags,
2451 pub offset: optional_offset,
2452 pub timeout: option_duration,
2453}
2454#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2455const _: () = {
2456 ["Size of io_ctx"][::core::mem::size_of::<io_ctx>() - 40usize];
2457 ["Alignment of io_ctx"][::core::mem::align_of::<io_ctx>() - 8usize];
2458 ["Offset of field: io_ctx::flags"][::core::mem::offset_of!(io_ctx, flags) - 0usize];
2459 ["Offset of field: io_ctx::offset"][::core::mem::offset_of!(io_ctx, offset) - 8usize];
2460 ["Offset of field: io_ctx::timeout"][::core::mem::offset_of!(io_ctx, timeout) - 16usize];
2461};
2462pub const endpoint_kind_Endpoint_Unspecified: endpoint_kind = 0;
2463pub const endpoint_kind_Endpoint_Socket: endpoint_kind = 1;
2464pub type endpoint_kind = ::core::ffi::c_uint;
2465#[repr(C)]
2466#[derive(Copy, Clone)]
2467pub union endpoint_addrs {
2468 pub socket_addr: socket_address,
2469}
2470#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2471const _: () = {
2472 ["Size of endpoint_addrs"][::core::mem::size_of::<endpoint_addrs>() - 32usize];
2473 ["Alignment of endpoint_addrs"][::core::mem::align_of::<endpoint_addrs>() - 4usize];
2474 ["Offset of field: endpoint_addrs::socket_addr"]
2475 [::core::mem::offset_of!(endpoint_addrs, socket_addr) - 0usize];
2476};
2477impl Default for endpoint_addrs {
2478 fn default() -> Self {
2479 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2480 unsafe {
2481 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2482 s.assume_init()
2483 }
2484 }
2485}
2486#[doc = " Endpoint addresses, for example, socket address."]
2487#[repr(C)]
2488#[derive(Copy, Clone)]
2489pub struct endpoint {
2490 pub kind: endpoint_kind,
2491 pub addr: endpoint_addrs,
2492}
2493#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2494const _: () = {
2495 ["Size of endpoint"][::core::mem::size_of::<endpoint>() - 36usize];
2496 ["Alignment of endpoint"][::core::mem::align_of::<endpoint>() - 4usize];
2497 ["Offset of field: endpoint::kind"][::core::mem::offset_of!(endpoint, kind) - 0usize];
2498 ["Offset of field: endpoint::addr"][::core::mem::offset_of!(endpoint, addr) - 4usize];
2499};
2500impl Default for endpoint {
2501 fn default() -> Self {
2502 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2503 unsafe {
2504 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2505 s.assume_init()
2506 }
2507 }
2508}
2509#[repr(C)]
2510#[derive(Debug, Copy, Clone)]
2511pub struct iovec {
2512 pub iov_base: *mut ::core::ffi::c_void,
2513 pub iov_len: usize,
2514}
2515#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2516const _: () = {
2517 ["Size of iovec"][::core::mem::size_of::<iovec>() - 16usize];
2518 ["Alignment of iovec"][::core::mem::align_of::<iovec>() - 8usize];
2519 ["Offset of field: iovec::iov_base"][::core::mem::offset_of!(iovec, iov_base) - 0usize];
2520 ["Offset of field: iovec::iov_len"][::core::mem::offset_of!(iovec, iov_len) - 8usize];
2521};
2522impl Default for iovec {
2523 fn default() -> Self {
2524 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2525 unsafe {
2526 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2527 s.assume_init()
2528 }
2529 }
2530}
2531unsafe extern "C-unwind" {
2532 #[doc = " Read from a file. May read less than specified len."]
2533 pub fn twz_rt_fd_pread(
2534 fd: descriptor,
2535 buf: *mut ::core::ffi::c_void,
2536 len: usize,
2537 ctx: *mut io_ctx,
2538 ) -> io_result;
2539}
2540unsafe extern "C-unwind" {
2541 #[doc = " Write to a file. May write less than specified len."]
2542 pub fn twz_rt_fd_pwrite(
2543 fd: descriptor,
2544 buf: *const ::core::ffi::c_void,
2545 len: usize,
2546 ctx: *mut io_ctx,
2547 ) -> io_result;
2548}
2549unsafe extern "C-unwind" {
2550 #[doc = " Seek to a specified point in the file."]
2551 pub fn twz_rt_fd_seek(fd: descriptor, whence: whence, offset: i64) -> io_result;
2552}
2553unsafe extern "C-unwind" {
2554 #[doc = " Read from a file. May read less than specified len. Fill *ep with information about the source of the I/O (e.g. socket address)."]
2555 pub fn twz_rt_fd_pread_from(
2556 fd: descriptor,
2557 buf: *mut ::core::ffi::c_void,
2558 len: usize,
2559 ctx: *mut io_ctx,
2560 ep: *mut endpoint,
2561 ) -> io_result;
2562}
2563unsafe extern "C-unwind" {
2564 #[doc = " Write to a file. May write less than specified len. Send to specified endpoint (e.g. socket address)."]
2565 pub fn twz_rt_fd_pwrite_to(
2566 fd: descriptor,
2567 buf: *const ::core::ffi::c_void,
2568 len: usize,
2569 ctx: *mut io_ctx,
2570 ep: *const endpoint,
2571 ) -> io_result;
2572}
2573unsafe extern "C-unwind" {
2574 #[doc = " Do vectored IO read."]
2575 pub fn twz_rt_fd_preadv(
2576 fd: descriptor,
2577 iovs: *const iovec,
2578 nr_iovs: usize,
2579 ctx: *mut io_ctx,
2580 ) -> io_result;
2581}
2582unsafe extern "C-unwind" {
2583 #[doc = " Do vectored IO write."]
2584 pub fn twz_rt_fd_pwritev(
2585 fd: descriptor,
2586 iovs: *const iovec,
2587 nr_iovs: usize,
2588 ctx: *mut io_ctx,
2589 ) -> io_result;
2590}
2591pub type wait_kind = u32;
2592pub const WAIT_READ: wait_kind = 1;
2593pub const WAIT_WRITE: wait_kind = 2;
2594unsafe extern "C-unwind" {
2595 #[doc = " Get a word and value to wait on for determining if reads or writes are available."]
2596 pub fn twz_rt_fd_waitpoint(
2597 fd: descriptor,
2598 ek: wait_kind,
2599 point: *mut *mut u64,
2600 val: *mut u64,
2601 ready: *mut bool,
2602 ) -> twz_error;
2603}
2604unsafe extern "C-unwind" {
2605 #[doc = " Select-like operation."]
2606 pub fn twz_rt_fd_select(
2607 nfds: usize,
2608 readfds: *mut fd_set,
2609 writefds: *mut fd_set,
2610 exceptfds: *mut fd_set,
2611 timeout: option_duration,
2612 ) -> io_result;
2613}
2614unsafe extern "C-unwind" {
2615 pub fn twz_rt_fd_poll(fds: *mut pollfd, nfds: usize, timeout: option_duration) -> io_result;
2616}
2617unsafe extern "C-unwind" {
2618 #[doc = " Get a config value for register reg."]
2619 pub fn twz_rt_fd_get_config(
2620 fd: descriptor,
2621 reg: u32,
2622 val: *mut ::core::ffi::c_void,
2623 len: usize,
2624 ) -> twz_error;
2625}
2626unsafe extern "C-unwind" {
2627 #[doc = " Set a config value for register reg. Setting a register may have side effects."]
2628 pub fn twz_rt_fd_set_config(
2629 fd: descriptor,
2630 reg: u32,
2631 val: *const ::core::ffi::c_void,
2632 len: usize,
2633 ) -> twz_error;
2634}
2635pub const IO_REGISTER_ADDR: u32 = 1;
2636pub const IO_REGISTER_PEER: u32 = 2;
2637pub const IO_REGISTER_SOCKET_FLAGS: u32 = 3;
2638pub const IO_REGISTER_LINGER: u32 = 4;
2639pub const IO_REGISTER_TTL: u32 = 5;
2640pub const IO_REGISTER_READTIMEOUT: u32 = 6;
2641pub const IO_REGISTER_WRITETIMEOUT: u32 = 7;
2642pub const IO_REGISTER_STATUS: u32 = 8;
2643pub const IO_REGISTER_SIGNAL: u32 = 9;
2644pub const IO_REGISTER_TERMIOS: u32 = 10;
2645pub const IO_REGISTER_MULTICAST_V4: u32 = 11;
2646pub const IO_REGISTER_MULTICAST_V6: u32 = 12;
2647pub const IO_REGISTER_MULTICAST_TTL_V4: u32 = 13;
2648pub const IO_REGISTER_IO_FLAGS: u32 = 14;
2649pub const IO_REGISTER_WINSIZE: u32 = 15;
2650pub const STATUS_FLAG_TERMINATED: u64 = 4294967296;
2651pub const STATUS_FLAG_READY: u64 = 8589934592;
2652pub const SOCKET_FLAGS_NODELAY: u32 = 1;
2653pub const SOCKET_FLAGS_ONLYV6: u32 = 2;
2654pub const SOCKET_FLAGS_BROADCAST: u32 = 4;
2655pub const SOCKET_FLAGS_MULTICAST_LOOP_V4: u32 = 8;
2656pub const SOCKET_FLAGS_MULTICAST_LOOP_V6: u32 = 16;
2657#[doc = " Result map_object call"]
2658#[repr(C)]
2659#[repr(align(16))]
2660#[derive(Debug, Copy, Clone)]
2661pub struct map_result {
2662 #[doc = " Handle, if error is set to Success."]
2663 pub handle: object_handle,
2664 pub error: twz_error,
2665}
2666#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2667const _: () = {
2668 ["Size of map_result"][::core::mem::size_of::<map_result>() - 64usize];
2669 ["Alignment of map_result"][::core::mem::align_of::<map_result>() - 16usize];
2670 ["Offset of field: map_result::handle"][::core::mem::offset_of!(map_result, handle) - 0usize];
2671 ["Offset of field: map_result::error"][::core::mem::offset_of!(map_result, error) - 48usize];
2672};
2673impl Default for map_result {
2674 fn default() -> Self {
2675 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2676 unsafe {
2677 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2678 s.assume_init()
2679 }
2680 }
2681}
2682#[doc = " Map with READ permission."]
2683pub const MAP_FLAG_R: map_flags = 1;
2684#[doc = " Map with WRITE permission."]
2685pub const MAP_FLAG_W: map_flags = 2;
2686#[doc = " Map with EXEC permission."]
2687pub const MAP_FLAG_X: map_flags = 4;
2688#[doc = " Persist changes on flush."]
2689pub const MAP_FLAG_PERSIST: map_flags = 8;
2690#[doc = " Allow the runtime to provide additional safety properties."]
2691pub const MAP_FLAG_INDIRECT: map_flags = 16;
2692#[doc = " Don't map a null page for the object."]
2693pub const MAP_FLAG_NO_NULLPAGE: map_flags = 32;
2694#[doc = " Mapping flags"]
2695pub type release_flags = u32;
2696#[doc = " Don't cache this handle on release."]
2697pub const RELEASE_NO_CACHE: release_flags = 1;
2698unsafe extern "C-unwind" {
2699 #[doc = " Create a new runtime (volatile, tied to this runtime) object."]
2700 pub fn twz_rt_create_rtobj() -> objid_result;
2701}
2702#[repr(C)]
2703#[repr(align(16))]
2704#[derive(Debug, Default, Copy, Clone)]
2705pub struct object_source {
2706 pub id: objid,
2707 pub src_start: u64,
2708 pub dest_start: u64,
2709 pub len: u64,
2710}
2711#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2712const _: () = {
2713 ["Size of object_source"][::core::mem::size_of::<object_source>() - 48usize];
2714 ["Alignment of object_source"][::core::mem::align_of::<object_source>() - 16usize];
2715 ["Offset of field: object_source::id"][::core::mem::offset_of!(object_source, id) - 0usize];
2716 ["Offset of field: object_source::src_start"]
2717 [::core::mem::offset_of!(object_source, src_start) - 16usize];
2718 ["Offset of field: object_source::dest_start"]
2719 [::core::mem::offset_of!(object_source, dest_start) - 24usize];
2720 ["Offset of field: object_source::len"][::core::mem::offset_of!(object_source, len) - 32usize];
2721};
2722#[repr(C)]
2723#[repr(align(16))]
2724#[derive(Debug, Default, Copy, Clone)]
2725pub struct object_tie {
2726 pub id: objid,
2727 pub flags: u32,
2728}
2729#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2730const _: () = {
2731 ["Size of object_tie"][::core::mem::size_of::<object_tie>() - 32usize];
2732 ["Alignment of object_tie"][::core::mem::align_of::<object_tie>() - 16usize];
2733 ["Offset of field: object_tie::id"][::core::mem::offset_of!(object_tie, id) - 0usize];
2734 ["Offset of field: object_tie::flags"][::core::mem::offset_of!(object_tie, flags) - 16usize];
2735};
2736#[repr(C)]
2737#[repr(align(16))]
2738#[derive(Debug, Default, Copy, Clone)]
2739pub struct object_create {
2740 pub kuid: objid,
2741 pub lifetime: u32,
2742 pub backing: u32,
2743 pub flags: u32,
2744 pub prot: u32,
2745}
2746#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2747const _: () = {
2748 ["Size of object_create"][::core::mem::size_of::<object_create>() - 32usize];
2749 ["Alignment of object_create"][::core::mem::align_of::<object_create>() - 16usize];
2750 ["Offset of field: object_create::kuid"][::core::mem::offset_of!(object_create, kuid) - 0usize];
2751 ["Offset of field: object_create::lifetime"]
2752 [::core::mem::offset_of!(object_create, lifetime) - 16usize];
2753 ["Offset of field: object_create::backing"]
2754 [::core::mem::offset_of!(object_create, backing) - 20usize];
2755 ["Offset of field: object_create::flags"]
2756 [::core::mem::offset_of!(object_create, flags) - 24usize];
2757 ["Offset of field: object_create::prot"]
2758 [::core::mem::offset_of!(object_create, prot) - 28usize];
2759};
2760pub const BACKING_TYPE_NORMAL: u32 = 0;
2761pub const LIFETIME_TYPE_VOLATILE: u32 = 0;
2762pub const LIFETIME_TYPE_PERSISTENT: u32 = 1;
2763unsafe extern "C-unwind" {
2764 pub fn twz_rt_create_object(
2765 spec: *const object_create,
2766 sources: *const object_source,
2767 nr_sources: usize,
2768 ties: *const object_tie,
2769 nr_ties: usize,
2770 name: *const ::core::ffi::c_char,
2771 namelen: usize,
2772 ) -> objid_result;
2773}
2774unsafe extern "C-unwind" {
2775 #[doc = " Map an object with a given ID and flags."]
2776 pub fn twz_rt_map_object(id: objid, flags: map_flags) -> map_result;
2777}
2778unsafe extern "C-unwind" {
2779 #[doc = " Release an object handle. After calling this, the handle may not be used."]
2780 pub fn twz_rt_release_handle(handle: *mut object_handle, flags: release_flags);
2781}
2782pub type object_cmd = u32;
2783pub const OBJECT_CMD_DELETE: object_cmd = 1;
2784pub const OBJECT_CMD_SYNC: object_cmd = 2;
2785pub const OBJECT_CMD_UPDATE: object_cmd = 3;
2786#[repr(C)]
2787#[derive(Debug, Copy, Clone)]
2788pub struct sync_info {
2789 pub release_compare: u64,
2790 pub release_set: u64,
2791 pub release_ptr: *mut u64,
2792 pub durable_ptr: *mut u64,
2793 pub flags: u32,
2794 pub __resv: u32,
2795}
2796#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2797const _: () = {
2798 ["Size of sync_info"][::core::mem::size_of::<sync_info>() - 40usize];
2799 ["Alignment of sync_info"][::core::mem::align_of::<sync_info>() - 8usize];
2800 ["Offset of field: sync_info::release_compare"]
2801 [::core::mem::offset_of!(sync_info, release_compare) - 0usize];
2802 ["Offset of field: sync_info::release_set"]
2803 [::core::mem::offset_of!(sync_info, release_set) - 8usize];
2804 ["Offset of field: sync_info::release_ptr"]
2805 [::core::mem::offset_of!(sync_info, release_ptr) - 16usize];
2806 ["Offset of field: sync_info::durable_ptr"]
2807 [::core::mem::offset_of!(sync_info, durable_ptr) - 24usize];
2808 ["Offset of field: sync_info::flags"][::core::mem::offset_of!(sync_info, flags) - 32usize];
2809 ["Offset of field: sync_info::__resv"][::core::mem::offset_of!(sync_info, __resv) - 36usize];
2810};
2811impl Default for sync_info {
2812 fn default() -> Self {
2813 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2814 unsafe {
2815 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2816 s.assume_init()
2817 }
2818 }
2819}
2820pub const SYNC_FLAG_DURABLE: u32 = 1;
2821pub const SYNC_FLAG_ASYNC_DURABLE: u32 = 2;
2822unsafe extern "C-unwind" {
2823 #[doc = " Modify an object."]
2824 pub fn twz_rt_object_cmd(
2825 handle: *mut object_handle,
2826 cmd: object_cmd,
2827 data: *mut ::core::ffi::c_void,
2828 ) -> twz_error;
2829}
2830unsafe extern "C-unwind" {
2831 #[doc = " Update an object handle."]
2832 pub fn twz_rt_update_handle(handle: *mut object_handle) -> twz_error;
2833}
2834unsafe extern "C-unwind" {
2835 #[doc = " Given a pointer, find the start of the associated object. The returned pointer and the passed pointer p\n are guaranteed to be in the same object, allowing pointer arithmetic."]
2836 pub fn twz_rt_locate_object_start(p: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void;
2837}
2838unsafe extern "C-unwind" {
2839 #[doc = " Given a pointer, find the associated object. The returned pointer and the passed pointer p\n are guaranteed to be in the same object, allowing pointer arithmetic."]
2840 pub fn twz_rt_get_object_handle(p: *mut ::core::ffi::c_void) -> object_handle;
2841}
2842unsafe extern "C-unwind" {
2843 #[doc = " Resolve an FOT entry, returning an object handle for the target object with at least valid_len bytes of\n addressable memory."]
2844 pub fn twz_rt_resolve_fot(
2845 handle: *mut object_handle,
2846 idx: u64,
2847 valid_len: usize,
2848 flags: map_flags,
2849 ) -> map_result;
2850}
2851unsafe extern "C-unwind" {
2852 #[doc = " Does the same as twz_rt_resolve_fot but optimizes for local pointers and avoids cloning handles if possible. Returns null on failure\n with no error code. Callers should try the twz_rt_resolve_fot function if this one fails."]
2853 pub fn twz_rt_resolve_fot_local(
2854 start: *mut ::core::ffi::c_void,
2855 idx: u64,
2856 valid_len: usize,
2857 flags: map_flags,
2858 ) -> *mut ::core::ffi::c_void;
2859}
2860unsafe extern "C-unwind" {
2861 #[doc = " Insert the given entry into the FOT, or return the existing entry if it already exists in this object's FOT.\n Returns -1 on failure."]
2862 pub fn twz_rt_insert_fot(
2863 handle: *mut object_handle,
2864 entry: *mut ::core::ffi::c_void,
2865 ) -> u32_result;
2866}
2867unsafe extern "C-unwind" {
2868 pub fn __twz_rt_map_two_objects(
2869 id_1: objid,
2870 flags_1: map_flags,
2871 id_2: objid,
2872 flags_2: map_flags,
2873 res_1: *mut map_result,
2874 res_2: *mut map_result,
2875 );
2876}
2877pub const monotonicity_NonMonotonic: monotonicity = 0;
2878pub const monotonicity_WeakMonotonic: monotonicity = 1;
2879pub const monotonicity_StrongMonotonic: monotonicity = 2;
2880#[doc = " Supported monotonicity levels"]
2881pub type monotonicity = ::core::ffi::c_uint;
2882unsafe extern "C-unwind" {
2883 #[doc = " Get time from the monotonic clock"]
2884 pub fn twz_rt_get_monotonic_time() -> duration;
2885}
2886unsafe extern "C-unwind" {
2887 #[doc = " Get time from the system clock"]
2888 pub fn twz_rt_get_system_time() -> duration;
2889}
2890#[doc = " Information about a loaded dynamic object"]
2891#[repr(C)]
2892#[derive(Debug, Copy, Clone)]
2893pub struct dl_phdr_info {
2894 #[doc = " Load address"]
2895 pub addr: usize,
2896 #[doc = " Pointer to name, as a C string"]
2897 pub name: *const ::core::ffi::c_char,
2898 #[doc = " Pointer to program headers"]
2899 pub phdr: *const ::core::ffi::c_void,
2900 #[doc = " Number of program headers"]
2901 pub phnum: u32,
2902 pub adds: ::core::ffi::c_ulonglong,
2903 pub subs: ::core::ffi::c_ulonglong,
2904 pub tls_modid: usize,
2905 pub tls_data: *mut ::core::ffi::c_void,
2906}
2907#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2908const _: () = {
2909 ["Size of dl_phdr_info"][::core::mem::size_of::<dl_phdr_info>() - 64usize];
2910 ["Alignment of dl_phdr_info"][::core::mem::align_of::<dl_phdr_info>() - 8usize];
2911 ["Offset of field: dl_phdr_info::addr"][::core::mem::offset_of!(dl_phdr_info, addr) - 0usize];
2912 ["Offset of field: dl_phdr_info::name"][::core::mem::offset_of!(dl_phdr_info, name) - 8usize];
2913 ["Offset of field: dl_phdr_info::phdr"][::core::mem::offset_of!(dl_phdr_info, phdr) - 16usize];
2914 ["Offset of field: dl_phdr_info::phnum"]
2915 [::core::mem::offset_of!(dl_phdr_info, phnum) - 24usize];
2916 ["Offset of field: dl_phdr_info::adds"][::core::mem::offset_of!(dl_phdr_info, adds) - 32usize];
2917 ["Offset of field: dl_phdr_info::subs"][::core::mem::offset_of!(dl_phdr_info, subs) - 40usize];
2918 ["Offset of field: dl_phdr_info::tls_modid"]
2919 [::core::mem::offset_of!(dl_phdr_info, tls_modid) - 48usize];
2920 ["Offset of field: dl_phdr_info::tls_data"]
2921 [::core::mem::offset_of!(dl_phdr_info, tls_data) - 56usize];
2922};
2923impl Default for dl_phdr_info {
2924 fn default() -> Self {
2925 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2926 unsafe {
2927 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2928 s.assume_init()
2929 }
2930 }
2931}
2932#[repr(C)]
2933#[derive(Debug, Copy, Clone)]
2934pub struct link_map {
2935 pub addr: usize,
2936 pub name: *mut ::core::ffi::c_char,
2937 pub ld: *mut ::core::ffi::c_void,
2938 pub next: *mut ::core::ffi::c_void,
2939 pub prev: *mut ::core::ffi::c_void,
2940}
2941#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2942const _: () = {
2943 ["Size of link_map"][::core::mem::size_of::<link_map>() - 40usize];
2944 ["Alignment of link_map"][::core::mem::align_of::<link_map>() - 8usize];
2945 ["Offset of field: link_map::addr"][::core::mem::offset_of!(link_map, addr) - 0usize];
2946 ["Offset of field: link_map::name"][::core::mem::offset_of!(link_map, name) - 8usize];
2947 ["Offset of field: link_map::ld"][::core::mem::offset_of!(link_map, ld) - 16usize];
2948 ["Offset of field: link_map::next"][::core::mem::offset_of!(link_map, next) - 24usize];
2949 ["Offset of field: link_map::prev"][::core::mem::offset_of!(link_map, prev) - 32usize];
2950};
2951impl Default for link_map {
2952 fn default() -> Self {
2953 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2954 unsafe {
2955 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2956 s.assume_init()
2957 }
2958 }
2959}
2960#[doc = " An ID for a loaded program image (or library)"]
2961pub type loaded_image_id = u32;
2962#[doc = " Information about a loaded program image or library"]
2963#[repr(C)]
2964#[repr(align(16))]
2965#[derive(Debug, Copy, Clone)]
2966pub struct loaded_image {
2967 #[doc = " Object handle"]
2968 pub image_handle: object_handle,
2969 #[doc = " Start of full image"]
2970 pub image_start: *const ::core::ffi::c_void,
2971 #[doc = " Length of full image"]
2972 pub image_len: usize,
2973 #[doc = " The dl_info for this loaded image"]
2974 pub dl_info: dl_phdr_info,
2975 #[doc = " The ID for this loaded image"]
2976 pub id: loaded_image_id,
2977}
2978#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2979const _: () = {
2980 ["Size of loaded_image"][::core::mem::size_of::<loaded_image>() - 144usize];
2981 ["Alignment of loaded_image"][::core::mem::align_of::<loaded_image>() - 16usize];
2982 ["Offset of field: loaded_image::image_handle"]
2983 [::core::mem::offset_of!(loaded_image, image_handle) - 0usize];
2984 ["Offset of field: loaded_image::image_start"]
2985 [::core::mem::offset_of!(loaded_image, image_start) - 48usize];
2986 ["Offset of field: loaded_image::image_len"]
2987 [::core::mem::offset_of!(loaded_image, image_len) - 56usize];
2988 ["Offset of field: loaded_image::dl_info"]
2989 [::core::mem::offset_of!(loaded_image, dl_info) - 64usize];
2990 ["Offset of field: loaded_image::id"][::core::mem::offset_of!(loaded_image, id) - 128usize];
2991};
2992impl Default for loaded_image {
2993 fn default() -> Self {
2994 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2995 unsafe {
2996 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2997 s.assume_init()
2998 }
2999 }
3000}
3001unsafe extern "C-unwind" {
3002 #[doc = " Get a loaded image from its ID. All IDs for loaded image are sequential, starting from TWZ_RT_EXEID.\n On success, fill out data pointed to by the li argument and return true."]
3003 pub fn twz_rt_get_loaded_image(id: loaded_image_id, li: *mut loaded_image) -> bool;
3004}
3005unsafe extern "C-unwind" {
3006 pub fn twz_rt_iter_phdr(
3007 cb: ::core::option::Option<
3008 unsafe extern "C-unwind" fn(
3009 arg1: *const dl_phdr_info,
3010 size: usize,
3011 data: *mut ::core::ffi::c_void,
3012 ) -> ::core::ffi::c_int,
3013 >,
3014 data: *mut ::core::ffi::c_void,
3015 ) -> ::core::ffi::c_int;
3016}
3017#[doc = " The loaded image ID for the root loaded image (usually the executable)"]
3018pub const TWZ_RT_EXEID: loaded_image_id = 0;
3019#[doc = " Information about the system"]
3020#[repr(C)]
3021#[derive(Debug, Copy, Clone)]
3022pub struct system_info {
3023 #[doc = " Supported monotonicity"]
3024 pub clock_monotonicity: monotonicity,
3025 #[doc = " Number of CPUs (hardware threads)"]
3026 pub available_parallelism: usize,
3027 #[doc = " Page size"]
3028 pub page_size: usize,
3029}
3030#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3031const _: () = {
3032 ["Size of system_info"][::core::mem::size_of::<system_info>() - 24usize];
3033 ["Alignment of system_info"][::core::mem::align_of::<system_info>() - 8usize];
3034 ["Offset of field: system_info::clock_monotonicity"]
3035 [::core::mem::offset_of!(system_info, clock_monotonicity) - 0usize];
3036 ["Offset of field: system_info::available_parallelism"]
3037 [::core::mem::offset_of!(system_info, available_parallelism) - 8usize];
3038 ["Offset of field: system_info::page_size"]
3039 [::core::mem::offset_of!(system_info, page_size) - 16usize];
3040};
3041impl Default for system_info {
3042 fn default() -> Self {
3043 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3044 unsafe {
3045 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3046 s.assume_init()
3047 }
3048 }
3049}
3050unsafe extern "C-unwind" {
3051 #[doc = " Get system information"]
3052 pub fn twz_rt_get_sysinfo() -> system_info;
3053}
3054#[doc = " Flags to get_random"]
3055pub type get_random_flags = u32;
3056#[doc = " Do not block when collecting random data"]
3057pub const GET_RANDOM_NON_BLOCKING: get_random_flags = 1;
3058unsafe extern "C-unwind" {
3059 #[doc = " Collect up to len bytes of randomness, filling buf. Returns the number of bytes\n of random data actually collected."]
3060 pub fn twz_rt_get_random(
3061 buf: *mut ::core::ffi::c_char,
3062 len: usize,
3063 flags: get_random_flags,
3064 ) -> usize;
3065}
3066pub const version: &[u8; 7] = b"0.99.0\0";
3067#[doc = " Object ID"]
3068pub type __uint128_t = u128;