logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

io_uring_register_eventfd - register an eventfd with a ring

Description

io_uring_register_eventfd(3) registers the eventfd file descriptor fd with the ring identified by ring.

       Whenever  completions are posted to the CQ ring, an eventfd notification is generated with the registered
       eventfd descriptor. If io_uring_register_eventfd_async(3) is used, only events that completed out-of-line
       will trigger a notification.

       It notifications are no longer desired,  io_uring_unregister_eventfd(3)  may  be  called  to  remove  the
       eventfd registration. No eventfd argument is needed, as a ring can only have a single eventfd registered.

Name

       io_uring_register_eventfd - register an eventfd with a ring

Notes

       While  io_uring  generally  takes  care  to  avoid  spurious  events, they can occur.  Similarly, batched
       completions of CQEs may only trigger a single eventfd notification even if multiple CQEs are posted.  The
       application should make no assumptions on number of events being available having a direct correlation to
       eventfd notifications posted. An eventfd notification must thus only be treated as a hint to check the CQ
       ring for completions.

Return Value

       Returns 0 on success, or -errno on error.

See Also

eventfd(2)

liburing-2.2                                     April 16, 2022                     io_uring_register_eventfd(3)

Synopsis

#include<liburing.h>intio_uring_register_eventfd(structio_uring*ring,intfd);intio_uring_register_eventfd_async(structio_uring*ring,intfd);intio_uring_unregister_eventfd(structio_uring*ring);

See Also