during

Simple idiomatic dlang wrapper around linux io_uring (see: https://kernel.dk/io_uring.pdf) asynchronous API.

Modules

io_uring
module during.io_uring

io_uring system api definitions.

openat2
module during.openat2

Public Imports

during.io_uring
public import during.io_uring;

Members

Functions

fill
SubmissionEntry fill(SubmissionEntry entry, E op)

Uses custom operation definition to fill fields of SubmissionEntry. Can be used in cases, when builtin prep* functions aren't enough.

prepAccept
SubmissionEntry prepAccept(SubmissionEntry entry, int fd, ADDR addr, socklen_t addrlen, AcceptFlags flags)

Prepares accept4(2) operation.

prepCancel
SubmissionEntry prepCancel(SubmissionEntry entry, D userData, uint flags)

Prepares operation that cancels existing async work.

prepClose
SubmissionEntry prepClose(SubmissionEntry entry, int fd)

Note: Available from Linux 5.6

prepConnect
SubmissionEntry prepConnect(SubmissionEntry entry, int fd, const(ADDR) addr)

Note: Available from Linux 5.5

prepEpollCtl
SubmissionEntry prepEpollCtl(SubmissionEntry entry, int epfd, int fd, int op, epoll_event ev)

Note: Available from Linux 5.6

prepFadvise
SubmissionEntry prepFadvise(SubmissionEntry entry, int fd, long offset, uint len, int advice)

Note: Available from Linux 5.6

prepFallocate
SubmissionEntry prepFallocate(SubmissionEntry entry, int fd, int mode, long offset, long len)

Note: Available from Linux 5.6

prepFilesUpdate
SubmissionEntry prepFilesUpdate(SubmissionEntry entry, int[] fds, int offset)

Note: Available from Linux 5.6

prepFsync
SubmissionEntry prepFsync(SubmissionEntry entry, int fd, FsyncFlags flags)

Prepares fsync operation.

prepLinkTimeout
SubmissionEntry prepLinkTimeout(SubmissionEntry entry, KernelTimespec time, TimeoutFlags flags)

Prepares linked timeout operation.

prepMadvise
SubmissionEntry prepMadvise(SubmissionEntry entry, const(ubyte)[] block, int advice)

Note: Available from Linux 5.6

prepNop
SubmissionEntry prepNop(SubmissionEntry entry)

Prepares nop operation.

prepOpenat
SubmissionEntry prepOpenat(SubmissionEntry entry, int fd, char* path, int flags, uint mode)

Note: Available from Linux 5.6

prepOpenat2
SubmissionEntry prepOpenat2(SubmissionEntry entry, int fd, char* path, OpenHow how)

Note: Available from Linux 5.6

prepPollAdd
SubmissionEntry prepPollAdd(SubmissionEntry entry, int fd, PollEvents events)

Poll the fd specified in the submission queue entry for the events specified in the poll_events field. Unlike poll or epoll without EPOLLONESHOT, this interface always works in one shot mode. That is, once the poll operation is completed, it will have to be resubmitted.

prepPollRemove
SubmissionEntry prepPollRemove(SubmissionEntry entry, D userData)

Remove an existing poll request. If found, the res field of the CompletionEntry will contain 0. If not found, res will contain -ENOENT.

prepProvideBuffer
SubmissionEntry prepProvideBuffer(SubmissionEntry entry, ubyte[N] buf, ushort bgid, int bid)
SubmissionEntry prepProvideBuffer(SubmissionEntry entry, ubyte[] buf, ushort bgid, int bid)

Note: Available from Linux 5.7

prepProvideBuffers
SubmissionEntry prepProvideBuffers(SubmissionEntry entry, ubyte[][] buf, uint len, ushort bgid, int bid)
SubmissionEntry prepProvideBuffers(SubmissionEntry entry, ubyte[M][N] buf, ushort bgid, int bid)

Note: Available from Linux 5.7

prepRead
SubmissionEntry prepRead(SubmissionEntry entry, int fd, ubyte[] buffer, long offset)

Note: Available from Linux 5.6

prepReadFixed
SubmissionEntry prepReadFixed(SubmissionEntry entry, int fd, long offset, ubyte[] buffer, ushort bufferIndex)

Prepares read_fixed operation.

prepReadv
SubmissionEntry prepReadv(SubmissionEntry entry, int fd, V buffer, long offset)

Prepares readv operation.

prepRecv
SubmissionEntry prepRecv(SubmissionEntry entry, int sockfd, ubyte[] buf, MsgFlags flags)

Note: Available from Linux 5.6

prepRecv
SubmissionEntry prepRecv(SubmissionEntry entry, int sockfd, ushort gid, uint len, MsgFlags flags)

Variant that uses registered buffers group.

prepRecvMsg
SubmissionEntry prepRecvMsg(SubmissionEntry entry, int fd, msghdr msg, MsgFlags flags)

Prepares recvmsg(2) operation.

prepRemoveBuffers
SubmissionEntry prepRemoveBuffers(SubmissionEntry entry, int nr, ushort bgid)

Note: Available from Linux 5.7

prepSend
SubmissionEntry prepSend(SubmissionEntry entry, int sockfd, const(ubyte)[] buf, MsgFlags flags)

Note: Available from Linux 5.6

prepSendMsg
SubmissionEntry prepSendMsg(SubmissionEntry entry, int fd, msghdr msg, MsgFlags flags)

Prepares sendmsg(2) operation.

prepSplice
SubmissionEntry prepSplice(SubmissionEntry entry, int fd_in, ulong off_in, int fd_out, ulong off_out, uint nbytes, uint splice_flags)

Note: Available from Linux 5.7

prepStatx
SubmissionEntry prepStatx(SubmissionEntry entry, int fd, char* path, int flags, uint mask, Statx statxbuf)

Note: Available from Linux 5.6

prepSyncFileRange
SubmissionEntry prepSyncFileRange(SubmissionEntry entry, int fd, ulong offset, uint len, SyncFileRangeFlags flags)

Prepares sync_file_range(2) operation.

prepTee
SubmissionEntry prepTee(SubmissionEntry entry, int fd_in, int fd_out, uint nbytes, uint flags)

Note: Available from Linux 5.8

prepTimeout
SubmissionEntry prepTimeout(SubmissionEntry entry, KernelTimespec time, ulong count, TimeoutFlags flags)

This command will register a timeout operation.

prepTimeoutRemove
SubmissionEntry prepTimeoutRemove(SubmissionEntry entry, D userData)

Prepares operations to remove existing timeout registered using TIMEOUToperation.

prepWrite
SubmissionEntry prepWrite(SubmissionEntry entry, int fd, const(ubyte)[] buffer, long offset)

Note: Available from Linux 5.6

prepWriteFixed
SubmissionEntry prepWriteFixed(SubmissionEntry entry, int fd, long offset, ubyte[] buffer, ushort bufferIndex)

Prepares write_fixed operation.

prepWritev
SubmissionEntry prepWritev(SubmissionEntry entry, int fd, V buffer, long offset)

Prepares writev operation.

setUserData
SubmissionEntry setUserData(SubmissionEntry entry, D data)

Template function to help set SubmissionEntry user_data field.

setUserDataRaw
SubmissionEntry setUserDataRaw(SubmissionEntry entry, D data)

Template function to help set SubmissionEntry user_data field. This differs to setUserData in that it emplaces the provided data directly into SQE user_data field and not the pointer to the data.

setup
int setup(Uring uring, uint entries, SetupFlags flags)

Setup new instance of io_uring into provided Uring structure.

userDataAs
D userDataAs(CompletionEntry entry)

Helper function to retrieve data set directly to the CompletionEntry user_data (set by setUserDataRaw).

Structs

Uring
struct Uring

Main entry point to work with io_uring.

Meta