1io_uring_register_eventfd(3)    liburing Manual   io_uring_register_eventfd(3)
2
3
4

NAME

6       io_uring_register_eventfd - register an eventfd with a ring
7

SYNOPSIS

9       #include <liburing.h>
10
11       int io_uring_register_eventfd(struct io_uring *ring,
12                                     int fd);
13
14       int io_uring_register_eventfd_async(struct io_uring *ring,
15                                           int fd);
16
17       int io_uring_unregister_eventfd(struct io_uring *ring);
18

DESCRIPTION

20       io_uring_register_eventfd(3)  registers  the eventfd file descriptor fd
21       with the ring identified by ring.
22
23       Whenever completions are posted to the CQ ring, an eventfd notification
24       is generated with the registered eventfd descriptor. If io_uring_regis‐
25       ter_eventfd_async(3) is used, only events  that  completed  out-of-line
26       will trigger a notification.
27
28       It  notifications are no longer desired, io_uring_unregister_eventfd(3)
29       may be called to remove the eventfd registration. No  eventfd  argument
30       is needed, as a ring can only have a single eventfd registered.
31
32

NOTES

34       While  io_uring generally takes care to avoid spurious events, they can
35       occur.  Similarly, batched completions of CQEs may only trigger a  sin‐
36       gle eventfd notification even if multiple CQEs are posted. The applica‐
37       tion should make no assumptions on number  of  events  being  available
38       having a direct correlation to eventfd notifications posted. An eventfd
39       notification must thus only be treated as a hint to check the  CQ  ring
40       for completions.
41

RETURN VALUE

43       Returns 0 on success, or or -errno on error.
44

SEE ALSO

46       eventfd(2)
47
48
49
50liburing-2.2                    April 16, 2022    io_uring_register_eventfd(3)
Impressum