Advanced usage¶
-
int
io_uring_register_buffers
(struct io_uring *ring, const struct iovec *iovecs, unsigned nr_iovecs)¶ Register buffers to be used with fixed buffer operations such as
io_uring_prep_write_fixed()
andio_uring_prep_read_fixed()
.Parameters
ring:
io_uring
structure as set up byio_uring_queue_init()
.iovecs: pointer to
iovec
structure(s).nr_iovecs: number of structures
iovec
structures
Return value: returns 0 on success and
-errono
on failure. You can use strerror(3) to get a human readable version of the reason for failure.
See also
Example program Fixed Buffers that uses this function.
-
int
io_uring_unregister_buffers
(struct io_uring *ring)¶ Unregister buffers registered by
io_uring_register_buffers()
.Parameters
ring:
io_uring
structure as set up byio_uring_queue_init()
.
Return value: returns 0 on success and
-errono
on failure. You can use strerror(3) to get a human readable version of the reason for failure.
See also
Example program Fixed Buffers that uses this function.
-
int
io_uring_register_files
(struct io_uring *ring, const int *files, unsigned nr_files)¶ Register file descriptors to be used in subsequent operations, like those that involve submission queue pollig (
IORING_SETUP_SQPOLL
).Parameters
ring:
io_uring
structure as set up byio_uring_queue_init()
.files: pointer to an array of file descriptors.
nr_files: number of file descriptors in the array.
Return value: returns 0 on success and
-errono
on failure. You can use strerror(3) to get a human readable version of the reason for failure.
See also
Example program Submission queue polling that uses this function.
-
int
io_uring_unregister_files
(struct io_uring *ring)¶ Unregister file descriptors registered by
io_uring_register_files()
.Parameters
ring:
io_uring
structure as set up byio_uring_queue_init()
.
Return value: returns 0 on success and
-errono
on failure. You can use strerror(3) to get a human readable version of the reason for failure.
See also
Example program Submission queue polling that uses this function.
-
int
io_uring_register_files_update
(struct io_uring *ring, unsigned off, int *files, unsigned nr_files)¶ Update the set of file descriptors registered with
io_uring_register_files()
.Parameters
ring:
io_uring
structure as set up byio_uring_queue_init()
.off: offset in the file descriptors array to update from.
files: array of file descriptors.
nr_files: number of file descriptors in the array supplied.
Return value: returns 0 on success and
-errono
on failure. You can use strerror(3) to get a human readable version of the reason for failure.
See also
-
int
io_uring_register_eventfd
(struct io_uring *ring, int fd)¶ By registering an eventfd(2) file descriptor with
io_uring
, it is possible to get notified of completion events on anio_uring
instance and this function lets you do just that.Parameters
ring:
io_uring
structure as set up byio_uring_queue_init()
.fd: the eventfd(2) file descriptor
Return value: returns 0 on success and
-errono
on failure. You can use strerror(3) to get a human readable version of the reason for failure.
See also
-
int
io_uring_register_eventfd_async
(struct io_uring *ring, int fd)¶ Same as
io_uring_register_eventfd()
, except notifications are only posted for events that complete in an async manner. This means that events that complete inline while being submitted do not trigger a notification event.Parameters
ring:
io_uring
structure as set up byio_uring_queue_init()
.fd: the eventfd(2) file descriptor
Return value: returns 0 on success and
-errono
on failure. You can use strerror(3) to get a human readable version of the reason for failure.
See also
-
int
io_uring_unregister_eventfd
(struct io_uring *ring)¶ Unregister the registered eventfd(2) file descriptor.
Parameters
ring:
io_uring
structure as set up byio_uring_queue_init()
.
Return value: returns 0 on success and
-errono
on failure. You can use strerror(3) to get a human readable version of the reason for failure.
See also
-
int
io_uring_register_personality
(struct io_uring *ring)¶ This operation registers credentials of the running application with
io_uring
, and returns an ID associated with these credentials. Applications wishing to share a ring between separate users/processes can pass in this credential ID in the SQEpersonality
field. If set, that particular sqe will be issued with these credentials.Parameters
ring:
io_uring
structure as set up byio_uring_queue_init()
.
Return value: returns the personality ID on success and
-errono
on failure. You can use strerror(3) to get a human readable version of the reason for failure.
-
int
io_uring_unregister_personality
(struct io_uring *ring, int id)¶ Unregisters a personality previously registered with
io_uring_register_personality()
.Parameters
ring:
io_uring
structure as set up byio_uring_queue_init()
.id: the personality ID to unregister.
Return value: returns 0 on success and
-errono
on failure. You can use strerror(3) to get a human readable version of the reason for failure.