Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions rusturing.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ extern inline void rust_io_uring_prep_splice(struct io_uring_sqe *sqe,
io_uring_prep_splice(sqe, fd_in, fd_out, off_in, off_out, nbytes, splice_flags);
}

extern inline void rust_io_uring_prep_tee(struct io_uring_sqe *sqe,
int fd_in, int fd_out,
unsigned int nbytes,
unsigned int splice_flags)
{
io_uring_prep_tee(sqe, fd_in, fd_out, nbytes, splice_flags);
}

extern inline void rust_io_uring_prep_readv(struct io_uring_sqe *sqe,
int fd,
const struct iovec *iovecs,
Expand Down Expand Up @@ -271,6 +279,25 @@ extern inline void rust_io_uring_prep_remove_buffers(struct io_uring_sqe *sqe,
io_uring_prep_remove_buffers(sqe, nr, bgid);
}

extern inline void rust_io_uring_prep_shutdown(struct io_uring_sqe *sqe, int fd,
int how)
{
io_uring_prep_shutdown(sqe, fd, how);
}

extern inline void rust_io_uring_prep_unlinkat(struct io_uring_sqe *sqe, int dfd,
const char *path, int flags)
{
io_uring_prep_unlinkat(sqe, dfd, path, flags);
}

extern inline void rust_io_uring_prep_renameat(struct io_uring_sqe *sqe, int olddfd,
const char *oldpath, int newdfd,
const char *newpath, int flags)
{
io_uring_prep_renameat(sqe, olddfd, oldpath, newdfd, newpath, flags);
}

extern inline unsigned rust_io_uring_sq_ready(struct io_uring *ring)
{
return io_uring_sq_ready(ring);
Expand Down
39 changes: 39 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ pub enum IoRingOp {
IORING_OP_PROVIDE_BUFFERS,
IORING_OP_REMOVE_BUFFERS,
IORING_OP_TEE,
IORING_OP_SHUTDOWN,
IORING_OP_RENAMEAT,
IORING_OP_UNLINKAT,
}

// sqe.flags
Expand Down Expand Up @@ -187,6 +190,8 @@ pub union cmd_flags {
pub statx_flags: libc::__u32,
pub fadvise_advice: libc::__u32,
pub splice_flags: libc::__u32,
pub rename_flags: libc::__u32,
pub unlink_flags: libc::__u32,
}

#[allow(non_camel_case_types)]
Expand Down Expand Up @@ -409,6 +414,15 @@ extern {
splice_flags: libc::c_uint,
);

#[link_name = "rust_io_uring_prep_tee"]
pub fn io_uring_prep_tee(
sqe: *mut io_uring_sqe,
fd_in: libc::c_int,
fd_out: libc::c_int,
nbytes: libc::c_uint,
splice_flags: libc::c_uint,
);

#[link_name = "rust_io_uring_prep_readv"]
pub fn io_uring_prep_readv(
sqe: *mut io_uring_sqe,
Expand Down Expand Up @@ -651,6 +665,31 @@ extern {
bgid: libc::c_int
);

#[link_name = "rust_io_uring_prep_shutdown"]
pub fn io_uring_prep_shutdown(
sqe: *mut io_uring_sqe,
fd: libc::c_int,
how: libc::c_int
);

#[link_name = "rust_io_uring_prep_unlinkat"]
pub fn io_uring_prep_unlinkat(
sqe: *mut io_uring_sqe,
dfd: libc::c_int,
path: *const libc::c_char,
flags: libc::c_int,
);

#[link_name = "rust_io_uring_prep_renameat"]
pub fn io_uring_prep_renameat(
sqe: *mut io_uring_sqe,
olddfd: libc::c_int,
oldpath: *const libc::c_char,
newdfd: libc::c_int,
newpath: *const libc::c_char,
flags: libc::c_int,
);

#[link_name = "rust_io_uring_sq_ready"]
pub fn io_uring_sq_ready(ring: *mut io_uring) -> libc::c_uint;

Expand Down