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_multishot(3)  behaves
29       identically in terms of events, but it persist across notifications and
30       will repeatedly post notifications for the  same  registration.  A  CQE
31       posted from a multishot poll request will have IORING_CQE_F_MORE set in
32       the CQE flags member, indicating that  the  application  should  expect
33       more  completions from this request. If the multishot poll request gets
34       terminated or experiences an error, this flag will not be  set  in  the
35       CQE.  If  this  happens, the application should not expect further CQEs
36       from the original request and must reissue a new one if it still wishes
37       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