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

NAME

6       io_uring_prep_poll_add - prepare a poll request
7

SYNOPSIS

9       #include <poll.h>
10       #include <liburing.h>
11
12       void io_uring_prep_poll_add(struct io_uring_sqe *sqe,
13                                   int fd,
14                                   unsigned poll_mask);
15
16       void io_uring_prep_poll_multishot(struct io_uring_sqe *sqe,
17                                         int fd,
18                                         unsigned poll_mask);
19

DESCRIPTION

21       The  io_uring_prep_poll_add(3)  function  prepares  a poll request. The
22       submission queue entry sqe is setup to use the file descriptor fd  that
23       should  get  polled, with the events desired specified in the poll_mask
24       argument.
25
26       The default behavior is a single-shot poll request. When the  specified
27       event has triggered, a completion CQE is posted and no more events will
28       be generated by the poll request.  io_uring_prep_poll_multishot(3)  be‐
29       haves  identically  in terms of events, but it persist across notifica‐
30       tions and will repeatedly post notifications for the same registration.
31       A  CQE posted from a multishot poll request will have IORING_CQE_F_MORE
32       set in the CQE flags member, indicating that the application should ex‐
33       pect  more completions from this request. If the multishot poll request
34       gets terminated or experiences an error, this flag will not be  set  in
35       the  CQE.  If  this  happens, the application should not expect further
36       CQEs from the original request and must reissue a new one if  it  still
37       wishes to get notifications on this file descriptor.
38
39

RETURN VALUE

41       None
42

ERRORS

44       The  CQE res field will contain the result of the operation, which is a
45       bitmask of the events notified. See the poll(2) man page  for  details.
46       Note  that where synchronous system calls will return -1 on failure and
47       set errno to the actual error value, io_uring never  uses  errno.   In‐
48       stead it returns the negated errno directly in the CQE res field.
49

SEE ALSO

51       io_uring_get_sqe(3), io_uring_submit(3), poll(2), epoll_ctl(3)
52
53
54
55liburing-2.2                    March 12, 2022       io_uring_prep_poll_add(3)
Impressum