uring_sys/
lib.rs

1pub mod syscalls;
2
3pub const LIBURING_UDATA_TIMEOUT: libc::__u64 = libc::__u64::max_value();
4
5// sqe opcode constants
6#[repr(C)]
7#[non_exhaustive]
8#[allow(nonstandard_style)]
9#[derive(Debug)]
10pub enum IoRingOp {
11    IORING_OP_NOP,
12    IORING_OP_READV,
13    IORING_OP_WRITEV,
14    IORING_OP_FSYNC,
15    IORING_OP_READ_FIXED,
16    IORING_OP_WRITE_FIXED,
17    IORING_OP_POLL_ADD,
18    IORING_OP_POLL_REMOVE,
19    IORING_OP_SYNC_FILE_RANGE,
20    IORING_OP_SENDMSG,
21    IORING_OP_RECVMSG,
22    IORING_OP_TIMEOUT,
23    IORING_OP_TIMEOUT_REMOVE,
24    IORING_OP_ACCEPT,
25    IORING_OP_ASYNC_CANCEL,
26    IORING_OP_LINK_TIMEOUT,
27    IORING_OP_CONNECT,
28    IORING_OP_FALLOCATE,
29    IORING_OP_OPENAT,
30    IORING_OP_CLOSE,
31    IORING_OP_FILES_UPDATE,
32    IORING_OP_STATX,
33    IORING_OP_READ,
34    IORING_OP_WRITE,
35    IORING_OP_FADVISE,
36    IORING_OP_MADVISE,
37    IORING_OP_SEND,
38    IORING_OP_RECV,
39    IORING_OP_OPENAT2,
40    IORING_OP_EPOLL_CTL,
41    IORING_OP_SPLICE,
42    IORING_OP_PROVIDE_BUFFERS,
43    IORING_OP_REMOVE_BUFFERS,
44    IORING_OP_TEE,
45}
46
47// sqe.flags
48pub const IOSQE_FIXED_FILE:             libc::__u8 = 1 << 0; /* use fixed fileset */
49pub const IOSQE_IO_DRAIN:               libc::__u8 = 1 << 1; /* issue after inflight IO */
50pub const IOSQE_IO_LINK:                libc::__u8 = 1 << 2; /* links next sqe */
51pub const IOSQE_IO_HARDLINK:            libc::__u8 = 1 << 3; /* like LINK, but stronger */
52pub const IOSQE_ASYNC:                  libc::__u8 = 1 << 4; /* always go async */
53pub const IOSQE_BUFFER_SELECT:          libc::__u8 = 1 << 5; /* select buf from sqe->buf_group */
54
55// sqe.cmd_flags.fsync_flags
56pub const IORING_FSYNC_DATASYNC:        libc::__u32 = 1 << 0;
57
58// sqe.cmd_flags.timeout_flags
59pub const IORING_TIMEOUT_ABS:           libc::__u32 = 1 << 0;
60
61// sqe.cmd_flags.splice_flags
62pub const SPLICE_F_FD_IN_FIXED:         libc::__u32 = 1 << 31;
63
64// io_uring_setup flags
65pub const IORING_SETUP_IOPOLL:	        libc::c_uint = 1 << 0; /* io_context is polled */
66pub const IORING_SETUP_SQPOLL:	        libc::c_uint = 1 << 1; /* SQ poll thread */
67pub const IORING_SETUP_SQ_AFF:	        libc::c_uint = 1 << 2; /* sq_thread_cpu is valid */
68pub const IORING_SETUP_CQSIZE:	        libc::c_uint = 1 << 3; /* app defines CQ size */
69pub const IORING_SETUP_CLAMP: 	        libc::c_uint = 1 << 4; /* clamp SQ/CQ ring sizes */
70pub const IORING_SETUP_ATTACH_WQ:       libc::c_uint = 1 << 5; /* attach to existing wq */
71
72// cqe.flags
73pub const IORING_CQE_BUFFER_SHIFT:      libc::c_uint = 1 << 0;
74
75// Magic offsets for the application to mmap the data it needs
76pub const IORING_OFF_SQ_RING:           libc::__u64 = 0;
77pub const IORING_OFF_CQ_RING:           libc::__u64 = 0x8000000;
78pub const IORING_OFF_SQES:              libc::__u64 = 0x10000000;
79
80// sq_ring.kflags
81pub const IORING_SQ_NEED_WAKEUP:        libc::c_uint = 1 << 0;
82pub const IORING_SQ_CQ_OVERFLOW:        libc::c_uint = 1 << 1;
83
84// cq_ring.kflags
85pub const IORING_CQ_EVENTFD_DISABLED:   libc::c_uint = 1 << 0;
86
87// io_uring_enter flags
88pub const IORING_ENTER_GETEVENTS:       libc::c_uint = 1 << 0;
89pub const IORING_ENTER_SQ_WAKEUP:       libc::c_uint = 1 << 1;
90
91// io_uring_params.features flags
92pub const IORING_FEAT_SINGLE_MMAP:      libc::__u32 = 1 << 0;
93pub const IORING_FEAT_NODROP:           libc::__u32 = 1 << 1;
94pub const IORING_FEAT_SUBMIT_STABLE:    libc::__u32 = 1 << 2;
95pub const IORING_FEAT_RW_CUR_POS:       libc::__u32 = 1 << 3;
96pub const IORING_FEAT_CUR_PERSONALITY:  libc::__u32 = 1 << 4;
97pub const IORING_FEAT_FAST_POLL:        libc::__u32 = 1 << 5;
98pub const IORING_FEAT_POLL_32BITS:      libc::__u32 = 1 << 6;
99
100// io_uring_register opcodes and arguments
101pub const IORING_REGISTER_BUFFERS:      libc::c_uint = 0;
102pub const IORING_UNREGISTER_BUFFERS:    libc::c_uint = 1;
103pub const IORING_REGISTER_FILES:        libc::c_uint = 2;
104pub const IORING_UNREGISTER_FILES:      libc::c_uint = 3;
105pub const IORING_REGISTER_EVENTFD:      libc::c_uint = 4;
106pub const IORING_UNREGISTER_EVENTFD:    libc::c_uint = 5;
107pub const IORING_REGISTER_FILES_UPDATE: libc::c_uint = 6;
108pub const IORING_REGISTER_EVENTFD_ASYNC:libc::c_uint = 7;
109pub const IORING_REGISTER_PROBE:        libc::c_uint = 8;
110pub const IORING_REGISTER_PERSONALITY:  libc::c_uint = 9;
111pub const IORING_UNREGISTER_PERSONALITY:libc::c_uint = 10;
112
113#[derive(Debug)]
114#[repr(C)]
115pub struct io_uring {
116    pub sq: io_uring_sq,
117    pub cq: io_uring_cq,
118    pub flags: libc::c_uint,
119    pub ring_fd: libc::c_int,
120}
121
122#[derive(Debug)]
123#[repr(C)]
124pub struct io_uring_sq {
125    pub khead: *mut libc::c_uint,
126    pub ktail: *mut libc::c_uint,
127    pub kring_mask: *mut libc::c_uint,
128    pub kring_entries: *mut libc::c_uint,
129    pub kflags: *mut libc::c_uint,
130    pub kdropped: *mut libc::c_uint,
131    pub array: *mut libc::c_uint,
132    pub sqes: *mut io_uring_sqe,
133
134    pub sqe_head: libc::c_uint,
135    pub sqe_tail: libc::c_uint,
136
137    pub ring_sz: libc::size_t,
138    pub ring_ptr: *mut libc::c_void,
139}
140
141#[derive(Debug)]
142#[repr(C)]
143pub struct io_uring_cq {
144    pub khead: *mut libc::c_uint,
145    pub ktail: *mut libc::c_uint,
146    pub kring_mask: *mut libc::c_uint,
147    pub kring_entries: *mut libc::c_uint,
148    pub kflags: *mut libc::c_uint,
149    pub koverflow: *mut libc::c_uint,
150    pub cqes: *mut io_uring_cqe,
151
152    pub ring_sz: libc::size_t,
153    pub ring_ptr: *mut libc::c_void,
154}
155
156#[repr(C)]
157pub struct io_uring_sqe {
158    pub opcode: libc::__u8,     /* type of operation for this sqe */
159    pub flags: libc::__u8,      /* IOSQE_ flags */
160    pub ioprio: libc::__u16,    /* ioprio for the request */
161    pub fd: libc::__s32,        /* file descriptor to do IO on */
162    pub off_addr2: off_addr2,
163    pub addr: libc::__u64,      /* pointer to buffer or iovecs */
164    pub len: libc::__u32,       /* buffer size or number of iovecs */
165    pub cmd_flags: cmd_flags,
166    pub user_data: libc::__u64, /* data to be passed back at completion time */
167    pub buf_index: buf_index_padding,   /* index into fixed buffers, if used */
168}
169
170#[repr(C)]
171pub union off_addr2 {
172    pub off: libc::__u64,
173    pub addr2: libc::__u64,
174}
175
176#[repr(C)]
177pub union cmd_flags {
178    pub rw_flags: __kernel_rwf_t,
179    pub fsync_flags: libc::__u32,
180    pub poll_events: libc::__u16,
181    pub sync_range_flags: libc::__u32,
182    pub msg_flags: libc::__u32,
183    pub timeout_flags: libc::__u32,
184    pub accept_flags: libc::__u32,
185    pub cancel_flags: libc::__u32,
186    pub open_flags: libc::__u32,
187    pub statx_flags: libc::__u32,
188    pub fadvise_advice: libc::__u32,
189    pub splice_flags: libc::__u32,
190}
191
192#[allow(non_camel_case_types)]
193type __kernel_rwf_t = libc::c_int;
194
195#[repr(C)]
196pub union buf_index_padding {
197    pub buf_index: buf_index,
198    pub __pad2: [libc::__u64; 3],
199}
200
201#[repr(C)]
202#[derive(Copy, Clone)]
203pub struct buf_index {
204    pub index_or_group: libc::__u16,
205    pub personality: libc::__u16,
206    pub splice_fd_in: libc::__s32,
207}
208
209#[repr(C)]
210pub struct io_uring_cqe {
211    pub user_data: libc::__u64, /* sqe->data submission passed back */
212    pub res: libc::__s32,       /* result code for this event */
213    pub flags: libc::__u32,
214}
215
216#[repr(C)]
217pub struct io_uring_params {
218    pub sq_entries: libc::__u32,
219    pub cq_entries: libc::__u32,
220    pub flags: libc::__u32,
221    pub sq_thread_cpu: libc::__u32,
222    pub sq_thread_idle: libc::__u32,
223    pub features: libc::__u32,
224    pub wq_fd: libc::__u32,
225    pub resv: [libc::__u32; 3],
226    pub sq_off: io_sqring_offsets,
227    pub cq_off: io_cqring_offsets,
228}
229
230#[repr(C)]
231pub struct io_sqring_offsets {
232    pub head: libc::__u32,
233    pub tail: libc::__u32,
234    pub ring_mask: libc::__u32,
235    pub ring_entries: libc::__u32,
236    pub flags: libc::__u32,
237    pub dropped: libc::__u32,
238    pub array: libc::__u32,
239    pub resv1: libc::__u32,
240    pub resv2: libc::__u64,
241}
242
243#[repr(C)]
244pub struct io_cqring_offsets {
245    pub head: libc::__u32,
246    pub tail: libc::__u32,
247    pub ring_mask: libc::__u32,
248    pub ring_entries: libc::__u32,
249    pub overflow: libc::__u32,
250    pub cqes: libc::__u32,
251    pub resv: [libc::__u64; 2],
252}
253
254#[repr(C)]
255pub struct io_uring_probe {
256    last_op: libc::__u8,
257    ops_len: libc::__u8,
258    resv: libc::__u16,
259    resv2: [libc::__u32; 3],
260    ops: [io_uring_probe_op; 0],
261}
262
263#[repr(C)]
264pub struct io_uring_probe_op {
265    op: libc::__u8,
266    resv: libc::__u8,
267    flags: libc::__u16,
268    resv2: libc::__u32,
269}
270
271#[repr(C)]
272pub struct __kernel_timespec {
273    pub tv_sec: i64,
274    pub tv_nsec: libc::c_longlong,
275}
276
277#[link(name = "uring")]
278extern {
279    pub fn io_uring_queue_init(
280        entries: libc::c_uint,
281        ring: *mut io_uring,
282        flags: libc::c_uint,
283    ) -> libc::c_int;
284
285    pub fn io_uring_queue_init_params(
286        entries: libc::c_uint,
287        ring: *mut io_uring,
288        params: *mut io_uring_params,
289    ) -> libc::c_int;
290
291    pub fn io_uring_queue_mmap(
292        fd: libc::c_int,
293        params: *mut io_uring_params,
294        ring: *mut io_uring,
295    ) -> libc::c_int;
296
297    pub fn io_uring_get_probe_ring(ring: *mut io_uring) -> *mut io_uring_probe;
298
299    pub fn io_uring_get_probe() -> *mut io_uring_probe;
300
301    pub fn io_uring_dontfork(ring: *mut io_uring) -> libc::c_int;
302
303    pub fn io_uring_queue_exit(ring: *mut io_uring);
304
305    pub fn io_uring_peek_batch_cqe(
306        ring: *mut io_uring,
307        cqes: *mut *mut io_uring_cqe,
308        count: libc::c_uint
309    ) -> libc::c_uint;
310
311    pub fn io_uring_wait_cqes(
312        ring: *mut io_uring,
313        cqe_ptr: *mut *mut io_uring_cqe,
314        wait_nr: libc::c_uint,
315        ts: *const __kernel_timespec,
316        sigmask: *const libc::sigset_t
317    ) -> libc::c_int;
318
319    pub fn io_uring_wait_cqe_timeout(
320        ring: *mut io_uring,
321        cqe_ptr: *mut *mut io_uring_cqe,
322        ts: *mut __kernel_timespec
323    ) -> libc::c_int;
324
325    pub fn io_uring_submit(ring: *mut io_uring) -> libc::c_int;
326
327    pub fn io_uring_submit_and_wait(ring: *mut io_uring, wait_nr: libc::c_uint) -> libc::c_int;
328
329    pub fn io_uring_get_sqe(ring: *mut io_uring) -> *mut io_uring_sqe;
330
331    pub fn io_uring_register_buffers(
332        ring: *mut io_uring,
333        iovecs: *const libc::iovec,
334        nr_iovecs: libc::c_uint,
335    ) -> libc::c_int;
336
337    pub fn io_uring_unregister_buffers(ring: *mut io_uring) -> libc::c_int;
338
339    pub fn io_uring_register_files(
340        ring: *mut io_uring,
341        files: *const libc::c_int,
342        nr_files: libc::c_uint,
343    ) -> libc::c_int;
344
345    pub fn io_uring_unregister_files(ring: *mut io_uring) -> libc::c_int;
346
347    pub fn io_uring_register_files_update(
348        ring: *mut io_uring,
349        off: libc::c_uint,
350        files: *const libc::c_int,
351        nr_files: libc::c_uint,
352    ) -> libc::c_int;
353
354    pub fn io_uring_register_eventfd(ring: *mut io_uring, fd: libc::c_int) -> libc::c_int;
355
356    pub fn io_uring_register_eventfd_async(ring: *mut io_uring, fd: libc::c_int) -> libc::c_int;
357
358    pub fn io_uring_unregister_eventfd(ring: *mut io_uring) -> libc::c_int;
359
360    pub fn io_uring_register_probe(
361        ring: *mut io_uring,
362        p: *mut io_uring_probe,
363        nr: libc::c_uint
364    ) -> libc::c_int;
365
366    pub fn io_uring_register_personality(ring: *mut io_uring) -> libc::c_int;
367
368    pub fn io_uring_unregister_personality(ring: *mut io_uring, id: libc::c_int) -> libc::c_int;
369}
370
371#[link(name = "rusturing")]
372extern {
373    #[link_name = "rust_io_uring_opcode_supported"]
374    pub fn io_uring_opcode_supported(p: *mut io_uring_probe, op: libc::c_int) -> libc::c_int;
375
376    #[link_name = "rust_io_uring_cq_advance"]
377    pub fn io_uring_cq_advance(ring: *mut io_uring, nr: libc::c_uint);
378
379    #[link_name = "rust_io_uring_cqe_seen"]
380    pub fn io_uring_cqe_seen(ring: *mut io_uring, cqe: *mut io_uring_cqe);
381
382    #[link_name = "rust_io_uring_sqe_set_data"]
383    pub fn io_uring_sqe_set_data(sqe: *mut io_uring_sqe, data: *mut libc::c_void);
384
385    #[link_name = "rust_io_uring_cqe_get_data"]
386    pub fn io_uring_cqe_get_data(cqe: *mut io_uring_cqe) -> *mut libc::c_void;
387
388    #[link_name = "rust_io_uring_sqe_set_flags"]
389    pub fn io_uring_sqe_set_flags(sqe: *mut io_uring_sqe, flags: libc::c_uint);
390
391    #[link_name = "rust_io_uring_prep_rw"]
392    pub fn io_uring_prep_rw(
393        op: libc::c_int,
394        sqe: *mut io_uring_sqe,
395        fd: libc::c_int,
396        addr: *const libc::c_void,
397        len: libc::c_uint,
398        offset: libc::__u64,
399    );
400
401    #[link_name = "rust_io_uring_prep_splice"]
402    pub fn io_uring_prep_splice(
403        sqe: *mut io_uring_sqe,
404        fd_in: libc::c_int,
405        off_in: libc::loff_t,
406        fd_out: libc::c_int,
407        off_out: libc::loff_t,
408        nbytes: libc::c_uint,
409        splice_flags: libc::c_uint,
410    );
411
412    #[link_name = "rust_io_uring_prep_readv"]
413    pub fn io_uring_prep_readv(
414        sqe: *mut io_uring_sqe,
415        fd: libc::c_int,
416        iovecs: *const libc::iovec,
417        nr_vecs: libc::c_uint,
418        offset: libc::off_t,
419    );
420
421    #[link_name = "rust_io_uring_prep_read_fixed"]
422    pub fn io_uring_prep_read_fixed(
423        sqe: *mut io_uring_sqe,
424        fd: libc::c_int,
425        buf: *mut libc::c_void,
426        nbytes: libc::c_uint,
427        offset: libc::off_t,
428        buf_index: libc::c_int,
429    );
430
431    #[link_name = "rust_io_uring_prep_writev"]
432    pub fn io_uring_prep_writev(
433        sqe: *mut io_uring_sqe,
434        fd: libc::c_int,
435        iovecs: *const libc::iovec,
436        nr_vecs: libc::c_uint,
437        offset: libc::off_t,
438    );
439
440    #[link_name = "rust_io_uring_prep_write_fixed"]
441    pub fn io_uring_prep_write_fixed(
442        sqe: *mut io_uring_sqe,
443        fd: libc::c_int,
444        buf: *const libc::c_void,
445        nbytes: libc::c_uint,
446        offset: libc::off_t,
447        buf_index: libc::c_int,
448    );
449
450    #[link_name = "rust_io_uring_prep_recvmsg"]
451    pub fn io_uring_prep_recvmsg(
452        sqe: *mut io_uring_sqe,
453        fd: libc::c_int,
454        msg: *mut libc::msghdr,
455        flags: libc::c_uint,
456    );
457
458    #[link_name = "rust_io_uring_prep_sendmsg"]
459    pub fn io_uring_prep_sendmsg(
460        sqe: *mut io_uring_sqe,
461        fd: libc::c_int,
462        msg: *const libc::msghdr,
463        flags: libc::c_uint,
464    );
465
466    #[link_name = "rust_io_uring_prep_poll_add"]
467    pub fn io_uring_prep_poll_add(
468        sqe: *mut io_uring_sqe,
469        fd: libc::c_int,
470        poll_mask: libc::c_short,
471    );
472
473    #[link_name = "rust_io_uring_prep_poll_remove"]
474    pub fn io_uring_prep_poll_remove(sqe: *mut io_uring_sqe, user_data: *mut libc::c_void);
475
476    #[link_name = "rust_io_uring_prep_fsync"]
477    pub fn io_uring_prep_fsync(sqe: *mut io_uring_sqe, fd: libc::c_int, fsync_flags: libc::c_uint);
478
479    #[link_name = "rust_io_uring_prep_nop"]
480    pub fn io_uring_prep_nop(sqe: *mut io_uring_sqe);
481
482    #[link_name = "rust_io_uring_prep_timeout"]
483    pub fn io_uring_prep_timeout(
484        sqe: *mut io_uring_sqe,
485        ts: *mut __kernel_timespec,
486        count: libc::c_uint,
487        flags: libc::c_uint,
488    );
489
490    #[link_name = "rust_io_uring_prep_timeout_remove"]
491    pub fn io_uring_prep_timeout_remove(
492        sqe: *mut io_uring_sqe,
493        user_data: libc::__u64,
494        flags: libc::c_uint,
495    );
496
497    #[link_name = "rust_io_uring_prep_accept"]
498    pub fn io_uring_prep_accept(
499        sqe: *mut io_uring_sqe,
500        fd: libc::c_int,
501        addr: *mut libc::sockaddr,
502        addrlen: *mut libc::socklen_t,
503        flags: libc::c_int,
504    );
505
506    #[link_name = "rust_io_uring_prep_cancel"]
507    pub fn io_uring_prep_cancel(
508        sqe: *mut io_uring_sqe,
509        user_data: *mut libc::c_void,
510        flags: libc::c_int,
511    );
512
513    #[link_name = "rust_io_uring_prep_link_timeout"]
514    pub fn io_uring_prep_link_timeout(
515        sqe: *mut io_uring_sqe,
516        ts: *mut __kernel_timespec,
517        flags: libc::c_uint,
518    );
519
520    #[link_name = "rust_io_uring_prep_connect"]
521    pub fn io_uring_prep_connect(
522        sqe: *mut io_uring_sqe,
523        fd: libc::c_int,
524        addr: *mut libc::sockaddr,
525        addrlen: libc::socklen_t,
526    );
527
528    #[link_name = "rust_io_uring_prep_files_update"]
529    pub fn io_uring_prep_files_update(
530        sqe: *mut io_uring_sqe,
531        fds: *mut libc::c_int,
532        nr_fds: libc::c_uint,
533        offset: libc::c_int,
534    );
535
536    #[link_name = "rust_io_uring_prep_fallocate"]
537    pub fn io_uring_prep_fallocate(
538        sqe: *mut io_uring_sqe,
539        fd: libc::c_int,
540        mode: libc::c_int,
541        offset: libc::off_t,
542        len: libc::off_t,
543    );
544
545    #[link_name = "rust_io_uring_prep_openat"]
546    pub fn io_uring_prep_openat(
547        sqe: *mut io_uring_sqe,
548        dfd: libc::c_int,
549        path: *const libc::c_char,
550        flags: libc::c_int,
551        mode: libc::mode_t,
552    );
553
554    #[link_name = "rust_io_uring_prep_close"]
555    pub fn io_uring_prep_close(sqe: *mut io_uring_sqe, fd: libc::c_int);
556
557    #[link_name = "rust_io_uring_prep_read"]
558    pub fn io_uring_prep_read(
559        sqe: *mut io_uring_sqe,
560        fd: libc::c_int,
561        buf: *mut libc::c_void,
562        nbytes: libc::c_uint,
563        offset: libc::off_t,
564    );
565
566    #[link_name = "rust_io_uring_prep_write"]
567    pub fn io_uring_prep_write(
568        sqe: *mut io_uring_sqe,
569        fd: libc::c_int,
570        buf: *const libc::c_void,
571        nbytes: libc::c_uint,
572        offset: libc::off_t,
573    );
574
575    #[link_name = "rust_io_uring_prep_statx"]
576    pub fn io_uring_prep_statx(
577        sqe: *mut io_uring_sqe,
578        dfd: libc::c_int,
579        path: *const libc::c_char,
580        flags: libc::c_int,
581        mask: libc::c_uint,
582        statx: *mut libc::statx,
583    );
584
585    #[link_name = "rust_io_uring_prep_fadvise: libc::c_int"]
586    pub fn io_uring_prep_fadvise(
587        sqe: *mut io_uring_sqe,
588        fd: libc::c_int,
589        offset: libc::off_t,
590        len: libc::off_t, advice:
591        libc::c_int,
592    );
593
594    #[link_name = "rust_io_uring_prep_madvise"]
595    pub fn io_uring_prep_madvise(
596        sqe: *mut io_uring_sqe,
597        addr: *mut libc::c_void,
598        length: libc::off_t,
599        advice: libc::c_int,
600    );
601
602    #[link_name = "rust_io_uring_prep_send"]
603    pub fn io_uring_prep_send(
604        sqe: *mut io_uring_sqe,
605        sockfd: libc::c_int,
606        buf: *const libc::c_void,
607        len: libc::size_t,
608        flags: libc::c_int,
609    );
610
611    #[link_name = "rust_io_uring_prep_recv"]
612    pub fn io_uring_prep_recv(
613        sqe: *mut io_uring_sqe,
614        sockfd: libc::c_int,
615        buf: *mut libc::c_void,
616        len: libc::size_t,
617        flags: libc::c_int,
618    );
619
620    #[link_name = "rust_io_uring_prep_openat2"]
621    pub fn io_uring_prep_openat2(
622        sqe: *mut io_uring_sqe,
623        dfd: libc::c_int,
624        path: *const libc::c_char,
625        how: *mut libc::c_void,
626    );
627
628    #[link_name = "rust_io_uring_prep_epoll_ctl"]
629    pub fn io_uring_prep_epoll_ctl(
630        sqe: *mut io_uring_sqe,
631        epfd: libc::c_int,
632        fd: libc::c_int,
633        op: libc::c_int,
634        ev: *mut libc::epoll_event,
635    );
636
637    #[link_name = "rust_io_uring_prep_provide_buffers"]
638    pub fn io_uring_prep_provide_buffers(
639        sqe: *mut io_uring_sqe,
640        addr: *mut libc::c_void,
641        len: libc::c_int,
642        nr: libc::c_int,
643        bgid: libc::c_int,
644        bid: libc::c_int
645    );
646
647    #[link_name = "rust_io_uring_prep_remove_buffers"]
648    pub fn io_uring_prep_remove_buffers(
649        sqe: *mut io_uring_sqe,
650        nr: libc::c_int,
651        bgid: libc::c_int
652    );
653
654    #[link_name = "rust_io_uring_sq_ready"]
655    pub fn io_uring_sq_ready(ring: *mut io_uring) -> libc::c_uint;
656
657    #[link_name = "rust_io_uring_sq_space_left"]
658    pub fn io_uring_sq_space_left(ring: *mut io_uring) -> libc::c_uint;
659
660    #[link_name = "rust_io_uring_cq_ready"]
661    pub fn io_uring_cq_ready(ring: *mut io_uring) -> libc::c_uint;
662
663    #[link_name = "rust_io_uring_wait_cqe_nr"]
664    pub fn io_uring_wait_cqe_nr(
665        ring: *mut io_uring,
666        cqe_ptr: *mut *mut io_uring_cqe,
667        wait_nr: libc::c_uint,
668    ) -> libc::c_int;
669
670    #[link_name = "rust_io_uring_cq_eventfd_enabled"]
671    pub fn io_uring_cq_eventfd_enabled(ring: *mut io_uring) -> bool;
672
673    #[link_name = "rust_io_uring_cq_eventfd_toggle"]
674    pub fn io_uring_cq_eventfd_toggle(ring: *mut io_uring, enabled: bool) -> libc::c_int;
675
676    #[link_name = "rust_io_uring_peek_cqe"]
677    pub fn io_uring_peek_cqe(ring: *mut io_uring, cqe_ptr: *mut *mut io_uring_cqe) -> libc::c_int;
678
679    #[link_name = "rust_io_uring_wait_cqe"]
680    pub fn io_uring_wait_cqe(ring: *mut io_uring, cqe_ptr: *mut *mut io_uring_cqe) -> libc::c_int;
681}