io_uring_prep_link_timeout(3)
β¨ io_uring_prep_link_timeout β¨
ok bestie so real talk, this is io_uring_prep_link_timeout from the liburing manual, section 3 π and it's giving "timeout but make it linked" energy, and honestly? obsessed.
πΈ NAME πΈ
io_uring_prep_link_timeout β a timeout request for linked sqes π
β¨ SYNOPSIS β¨
#include <liburing.h>
void io_uring_prep_link_timeout(struct io_uring_sqe *sqe,
const struct __kernel_timespec *ts,
unsigned flags);
π DESCRIPTION π
so the io_uring_prep_link_timeout(3) function prepares a timeout request for linked sqes, periodt. the submission queue entry sqe gets set up with the timeout you specify in ts, and the flags argument is where you drop your modifier flags that change how the timeout behaves, iykyk.
the ts argument has to be filled in with the right info for your timeout, no cap. it looks like this:
struct __kernel_timespec {
__kernel_time64_t tv_sec;
long long tv_nsec;
};
and the flags argument may contain:
IORING_TIMEOUT_ABSβ the value you put intsis an absolute value, not a relative one. no counting from now, we're picking a specific moment πIORING_TIMEOUT_BOOTTIMEβ the boottime clock source should be used. clock vibe check: boottime edition βIORING_TIMEOUT_REALTIMEβ the realtime clock source should be used. clock vibe check: realtime edition π¦IORING_TIMEOUT_ETIME_SUCCESSβ consider an expired timeout a success in terms of the posted completion. it expired and we're choosing to be unbothered β¨
bestie listen, it is invalid to create a chain (linked sqes) consisting only of a link timeout request. like, that's not a thing, don't do it π
so here's the tea on how it actually goes down: if all the requests in the chain complete before the timeout, then the link timeout request gets canceled. but upon timeout? all the uncompleted requests in the chain get canceled. the whole chain, girl π
π RETURN VALUE π
None. that's it, that's the whole section π«Ά
π ERRORS π
these are the errors that get reported in the CQE res field. on success, 0 is returned.
-ETIMEβ the specified timeout occurred and triggered the completion event. clock ran out, bestie β°-EINVALβ one of the fields set in the SQE was invalid. for example, two clock sources were given, or the specified timeout seconds or nanoseconds were< 0. you gave it something cursed, it said no π-EFAULTβio_uringwas unable to access the data specified byts. couldn't even reach it, tragic π-ECANCELEDβ the timeout was canceled because all submitted requests were completed successfully or one of the requests resulted in failure. mission accomplished (or mission flopped), timer's done either way β¨-ENOENTβ the request to which the linked timeout was linked already completed and could not be found when the timer expired. it went looking for its friend and the friend was already gone π
π¦ SEE ALSO π¦
and that's the whole page, bestie!! this was liburing manual, liburing-2.4 era, dated January 23, 2023 β so like, a lil vintage but still iconic ππ go prep those linked timeouts, you got this fr fr β¨πΈ
π¦ where this page comes from
- 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
- 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
- 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) 2023 Rutvik Patel <heyrutvik@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms