~sircmpwn/hare unlisted

fca24717bd6ad632f19cfebb435005d9658fcd47 — Drew DeVault 30 days ago cf284bd
linux::io_uring: add fsync

Signed-off-by: Drew DeVault <sir@cmpwn.com>
1 files changed, 14 insertions(+), 0 deletions(-)

M linux/io_uring/sqe.ha
M linux/io_uring/sqe.ha => linux/io_uring/sqe.ha +14 -0
@@ 109,3 109,17 @@ export fn write_fixed(
	preprw(sqe, op::WRITE_FIXED, fd, buf, count: u32, 0, flags...);
	sqe.buf_index = index;
};

// Prepares an fsync operation for an [[sqe]]. Note that operations are executed
// in parallel and not are completed in submission order, so an fsync submitted
// after a write may not cause the write to be accounted for by the fsync unless
// [[sqe_flags::IO_LINK]] is used.
export fn fsync(
	sqe: *sqe,
	fd: int,
	fsync_flags: fsync_flags,
	flags: sqe_flags...
) void = {
	preprw(sqe, op::FSYNC, fd, null, 0, 0, flags...);
	sqe.fsync_flags = fsync_flags;
};