io_uring_prep_poll_update(3)
π io_uring_prep_poll_update β bestie, we're updating a poll request
okay so this one's from the liburing manual, page io_uring_prep_poll_update(3), and it's literally about changing your mind about a poll request you already submitted. no cancel-and-rearm drama (well, sometimes drama, we'll get there). let's go π
β¨ NAME β¨
io_uring_prep_poll_update β update an existing poll request
πΈ SYNOPSIS πΈ
#include <poll.h>
#include <liburing.h>
void io_uring_prep_poll_update(struct io_uring_sqe *sqe,
__u64 old_user_data,
__u64 new_user_data,
unsigned poll_mask,
unsigned flags);
π¦ DESCRIPTION π¦
okay so the io_uring_prep_poll_update(3) function preps a poll update request, periodt. it takes your submission queue entry sqe and sets it up to update a poll request that it finds by old_user_data, swapping in the new_user_data info instead. the poll_mask argument is the shiny new mask your poll request is gonna use, and the flags argument is the modifier flags that tell io_uring which fields you actually want updated. iykyk π
the flags modifier flags situation is a bitmask, and it can contain an OR'ed mask of these lil guys:
IORING_POLL_UPDATE_EVENTSβ if you set this, the poll update request replaces the events currently being waited on with the ones you put in thepoll_maskargument. heads up though: only the lower 16 bits of events can be updated, so that's stuff likeEPOLLINandEPOLLOUT. higher order masks/settings live as internal state and cannot be modified β that includes settings likeEPOLLONESHOT,EPOLLEXCLUSIVE, andEPOLLET. if an application wants to change those, it has to cancel/remove the existing poll request and arm a whole new one. no shortcuts bestie πIORING_POLL_UPDATE_USER_DATAβ if you set this, the poll update request updates the existinguser_dataof the request with whatever value you passed in as thenew_user_dataargument. π«ΆIORING_POLL_ADD_MULTIβ if you set this, it flips the poll request from a singleshot to a multishot request. this one must be used along withIORING_POLL_UPDATE_EVENTS, because the event field has to be updated to enable multishot. they're a package deal, no solo acts β¨
π RETURN VALUE π
None. that's it, that's the whole section. it's a void function, she returns nothing and she's thriving π
π₯ ERRORS π₯
these are the errors reported in the CQE res field. on success, 0 is returned. π
-ENOENTβ the request identified byuser_datacould not be located. this could be because it completed before the cancelation request was issued, or because you used an invalid identifier. it's giving "who? never heard of her" π-EINVALβ one of the fields set in the SQE was invalid. π-EALREADYβ the execution state of the request has progressed far enough that cancelation is no longer possible. this should normally mean it'll complete shortly β either successfully, or interrupted due to the cancelation. so like, it's already out the door bestie, you can't call it back πβοΈ-ECANCELEDβIORING_POLL_UPDATE_EVENTSwas set and an error occurred re-arming the poll request with the new mask. the original poll request is terminated if this happens, and that termination CQE will contain the reason for the error re-arming. so yeah, when this hits, the original is gone and the CQE tells you why π
π SEE ALSO π
io_uring_get_sqe(3), io_uring_submit(3), io_uring_prep_poll_add(3), io_uring_prep_poll_multishot(3)
and that's the whole page, bestie! this one shipped with liburing-2.2, dated March 12, 2022 β go forth and update your polls responsibly πβ¨π
π¦ where this page comes from
- alpine 3.22: liburing-doc 2.9-r0 Β· LGPL-2.1-or-later OR MIT
- alpine 3.23: liburing-doc 2.12-r0 Β· LGPL-2.1-or-later OR MIT
- alpine 3.24: liburing-doc 2.14-r0 Β· LGPL-2.1-or-later OR MIT
- arch rolling: liburing 2.15-1 Β· GPL-2.0-only WITH Linux-syscall-note OR MIT AND LGPL-2.0-or-later AND MIT
- centos-stream 10: liburing-devel 2.12-1.el10 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- centos-stream 9: liburing-devel 2.12-1.el9 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- centos-stream 9: liburing-devel 2.12-1.el9 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- debian trixie: liburing-dev 2.9-1
- fedora 43: liburing-devel 2.9-2.fc43 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 43: liburing-devel 2.9-2.fc43 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 44: liburing-devel 2.13-2.fc44 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 44: liburing-devel 2.13-2.fc44 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- nixpkgs unstable: liburing 2.14
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- opensuse-leap 16.0: liburing-devel 2.8-160000.3.1 Β· (GPL-2.0-only AND LGPL-2.1-or-later) OR MIT
- ubuntu questing: liburing-dev 2.11-1
- ubuntu resolute: liburing-dev 2.14-1
- ubuntu stonking: liburing-dev 2.15-1
- π the page's license: LGPL-2.0-or-later
- Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms