liburing_sys/
lib.rs

1#![allow(non_upper_case_globals)]
2#![allow(non_camel_case_types)]
3#![allow(non_snake_case)]
4
5use libc;
6
7include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
8
9pub const IORING_OP_NOP: libc::c_int = 0;
10pub const IORING_OP_READV: libc::c_int = 1;
11pub const IORING_OP_WRITEV: libc::c_int = 2;
12pub const IORING_OP_FSYNC: libc::c_int = 3;
13pub const IORING_OP_READ_FIXED: libc::c_int = 4;
14pub const IORING_OP_WRITE_FIXED: libc::c_int = 5;
15
16pub unsafe fn io_uring_prep_readv(
17    sqe: *mut io_uring_sqe,
18    fd: libc::c_int,
19    iovecs: *mut libc::iovec,
20    nr_vecs: libc::c_uint,
21    offset: libc::off_t,
22) {
23    _io_uring_prep_readv(sqe, fd, std::mem::transmute(iovecs), nr_vecs, offset)
24}
25
26pub unsafe fn io_uring_prep_read_fixed(
27    sqe: *mut io_uring_sqe,
28    fd: libc::c_int,
29    buf: *mut libc::c_void,
30    nbytes: libc::c_uint,
31    offset: libc::off_t,
32) {
33    _io_uring_prep_read_fixed(sqe, fd, buf, nbytes, offset)
34}
35
36pub unsafe fn io_uring_prep_writev(
37    sqe: *mut io_uring_sqe,
38    fd: libc::c_int,
39    iovecs: *mut libc::iovec,
40    nr_vecs: libc::c_uint,
41    offset: libc::off_t,
42) {
43    _io_uring_prep_writev(sqe, fd, std::mem::transmute(iovecs), nr_vecs, offset)
44}
45
46pub unsafe fn io_uring_prep_write_fixed(
47    sqe: *mut io_uring_sqe,
48    fd: libc::c_int,
49    buf: *mut libc::c_void,
50    nbytes: libc::c_uint,
51    offset: libc::off_t,
52) {
53    _io_uring_prep_write_fixed(sqe, fd, buf, nbytes, offset)
54}
55
56pub unsafe fn io_uring_prep_fsync(
57    sqe: *mut io_uring_sqe,
58    fd: libc::c_int,
59    fsync_flags: libc::c_uint,
60) {
61    _io_uring_prep_fsync(sqe, fd, fsync_flags);
62}
63
64pub unsafe fn io_uring_prep_nop(sqe: *mut io_uring_sqe) {
65    _io_uring_prep_nop(sqe);
66}
67
68pub unsafe fn io_uring_cqe_seen(ring: *mut io_uring, cqe: *mut io_uring_cqe) {
69    _io_uring_cqe_seen(ring, cqe)
70}