io_uring_prep_symlinkat(3)

πŸ“¦
version 2.15 Β· 2 versions
  • 2.15 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 2.5 Β· debian bookworm, ubuntu noble
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ io_uring_prep_symlinkat ✨

okay bestie, so this is a page from the liburing Manual, and it's all about io_uring_prep_symlinkat(3) β€” the function that gets your symlink requests ready to go. no cap, it's giving "make a link, but async" πŸ’…


🌸 NAME 🌸

io_uring_prep_symlinkat β€” prepare a symlinkat request


πŸŽ€ SYNOPSIS πŸŽ€

#include <fcntl.h>
#include <unistd.h>
#include <liburing.h>

void io_uring_prep_symlinkat(struct io_uring_sqe *sqe,
                             const char *target,
                             int newdirfd,
                             const char *linkpath);

void io_uring_prep_symlink(struct io_uring_sqe *sqe,
                           const char *target,
                           const char *linkpath);

like, two whole functions, both of them icons πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

so, the io_uring_prep_symlinkat(3) function prepares a symlinkat request. it takes that submission queue entry, your sqe, and sets it up to symlink the target path that target points to, over to the new destination indicated by newdirfd and linkpath. that's the whole vibe 🌈

meanwhile, io_uring_prep_symlink(3) prepares a plain symlink request. the sqe gets set up to symlink the target path that target points to, over to the new destination indicated by linkpath β€” but this time relative to the current working directory. and yes, this one prepares an async symlink(2) request, so go read that man page for the deets πŸ‘‘

fr fr, these functions prepare an async symlinkat(2) or symlink(2) request. see those man pages for details. periodt πŸ’…


πŸ’œ RETURN VALUE πŸ’œ

None. that's it, that's the whole thing. nothing returned, no crumbs 🫢


πŸ’€ ERRORS πŸ’€

the CQE res field is where the result of the operation lives. check the related man page for what possible values it could be, iykyk.

but here's the tea, bestie: where synchronous system calls would return -1 on failure and set errno to the actual error value, io_uring never uses errno. instead it returns the negated errno directly in the CQE res field. so don't be out here checking errno, she's not the main character here 😭


πŸ”₯ NOTES πŸ”₯

okay so this is important. as with any request that passes in data in a struct, that data must remain valid until the request has been successfully submitted. it does not need to remain valid until completion. once a request has been submitted, the in-kernel state is stable β€” she's locked in, no takebacks ✨

very early kernels (5.4 and earlier) required state to be stable until the completion occurred. so if you're on ancient kernel energy, watch out πŸ’€

applications can test for this behavior by inspecting the IORING_FEAT_SUBMIT_STABLE flag passed back from io_uring_queue_init_params(3). go check that flag, it'll tell you what you're working with 🌟


⭐ SEE ALSO ⭐


and that's the whole page, bestie!! πŸŽ€ this one's from liburing-2.2, dated March 13, 2022 β€” so like, vintage but still slaying. go make some symlinks, you've got this πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from