AIO_RETURN(2)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… AIO_RETURN(2) β€” the aio_return glow-up ✨

okay bestie, so this one lives in the System Calls Manual section and honestly? it's a little icon. it's aio_return β€” and yes we're about to get into it 🫢


🌸 NAME 🌸

aio_return β€” retrieve the return status of an asynchronous I/O operation (REALTIME)

like, it goes and picks up the final answer for you πŸ’–


πŸŽ€ LIBRARY πŸŽ€

Standard C Library (libc, -lc) β€” the classic. no cap.


⭐ SYNOPSIS ⭐

#include <aio.h>

ssize_t
aio_return(struct aiocb *iocb);

literally that's it. one function, one pointer, main character energy πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe: the aio_return() system call returns the final status of the asynchronous I/O request associated with the structure that iocb points to. that's the whole job. it's giving "designated driver of the async world" 🌈

and the way that this is important β€” aio_return() should only be called once, to obtain the final status of an asynchronous I/O operation once it has completed. how do you know it's done? aio_error(2) returns something other than EINPROGRESS. that's your green flag, bestie πŸ’š

✨ read that again: once. not twice. not in a loop. not "just to check." once. periodt πŸ’…

πŸ”₯ RETURN VALUES πŸ”₯

if the asynchronous I/O request has completed, the status is returned as described in read(2), readv(2), write(2), writev(2), or fsync(2). so like, go read those if you want the deets on what the number actually means πŸ“–

otherwise, aio_return() returns -1 and sets errno to indicate the error condition. that's the "something went wrong" arc 😭


πŸ’€ ERRORS πŸ’€

the aio_return() system call will fail if:

  • [EINVAL] β€” the iocb argument does not reference a completed asynchronous I/O request. (translation: you jumped the gun, bestie, it's not done yet πŸ™ˆ)
  • [EINVAL] β€” the I/O operation was submitted with lio_listio(), and the value of the aio_lio_opcode is invalid. (yeah, same error code, different crime 🚨)

πŸ‘‘ SEE ALSO πŸ‘‘

aio_cancel(2), aio_error(2), aio_suspend(2), aio_waitcomplete(2), aio_write(2), fsync(2), read(2), write(2), aio(4)

the whole squad 🫢 go say hi


πŸ“œ STANDARDS πŸ“œ

the aio_return() system call is expected to conform to the IEEE Std 1003.1 (β€œPOSIX.1”) standard. certified, stamped, iconic πŸ’–


🧚 HISTORY 🧚

the aio_return() system call first appeared in FreeBSD 3.0. a legend since day one ⭐


πŸ“ AUTHORS πŸ“

this manual page was written by Wes Peters <wes@softweyr.com>. shoutout to Wes, we love a credited icon 🌸


and that's the page!! this dump came to you courtesy of Debian, dated January 11, 2021 β€” mwah, hope this helped, go get that final status bestie πŸ’œπŸŽ€

πŸ“¦ where this page comes from