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
Undocumented in source.
tests
module during.tests
Undocumented in source.

Public Imports

during.io_uring
public import during.io_uring;
Undocumented in source.

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.

prepAcceptDirect
SubmissionEntry prepAcceptDirect(SubmissionEntry entry, int fd, ADDR addr, socklen_t addrlen, uint fileIndex, AcceptFlags flags)

Same as prepAccept, but fd is put directly into fixed file table on fileIndex. Note: available from Linux 5.15

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

prepCloseDirect
SubmissionEntry prepCloseDirect(SubmissionEntry entry, int fd, uint fileIndex)

Same as prepClose but operation works directly with fd registered in fixed file table on index fileIndex. Note: Available from Linux 5.15

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.

prepLinkat
SubmissionEntry prepLinkat(SubmissionEntry entry, int olddirfd, const(char)* oldpath, int newdirfd, const(char)* newpath, int flags)

Note: Available from Linux 5.15

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

Note: Available from Linux 5.6

prepMkdirat
SubmissionEntry prepMkdirat(SubmissionEntry entry, int dirfd, const(char)* path, mode_t mode)

Note: Available from Linux 5.15

prepNop
SubmissionEntry prepNop(SubmissionEntry entry)

Prepares nop operation.

prepOpenat
SubmissionEntry prepOpenat(SubmissionEntry entry, int fd, const(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

prepOpenat2Direct
SubmissionEntry prepOpenat2Direct(SubmissionEntry entry, int fd, char* path, OpenHow how, uint fileIndex)

Same as prepOpenat2, but fd is put directly into fixed file table on fileIndex. Note: available from Linux 5.15

prepOpenatDirect
SubmissionEntry prepOpenatDirect(SubmissionEntry entry, int fd, const(char)* path, int flags, uint mode, uint fileIndex)

Same as prepOpenat, but fd is put directly into fixed file table on fileIndex. Note: available from Linux 5.15

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

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.

prepPollUpdate
SubmissionEntry prepPollUpdate(SubmissionEntry entry, U oldUserData, V newUserData, PollEvents events)

Allow events and user_data update of running poll requests.

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

prepRW
SubmissionEntry prepRW(SubmissionEntry entry, Operation op, int fd, void* addr, uint len, ulong offset)
Undocumented in source. Be warned that the author may not have intended to support it.
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

prepRenameat
SubmissionEntry prepRenameat(SubmissionEntry entry, int olddfd, const(char)* oldpath, int newfd, const(char)* newpath, int flags)

Note: Available from Linux 5.11

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.

prepShutdown
SubmissionEntry prepShutdown(SubmissionEntry entry, int fd, int how)

Note: Available from Linux 5.11

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

Note: Available from Linux 5.7

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

Note: Available from Linux 5.6

prepSymlinkat
SubmissionEntry prepSymlinkat(SubmissionEntry entry, const(char)* target, int newdirfd, const(char)* linkpath)

Note: Available from Linux 5.15

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.

prepTimeoutUpdate
SubmissionEntry prepTimeoutUpdate(SubmissionEntry entry, KernelTimespec time, D userData, TimeoutFlags flags)

Prepares operations to update existing timeout registered using TIMEOUToperation.

prepUnlinkat
SubmissionEntry prepUnlinkat(SubmissionEntry entry, int dirfd, const(char)* path, int flags)

Note: Available from Linux 5.11

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