AIO_SUSPEND(2)

✨ AIO_SUSPEND ✨ (section 2 of the manual, bestie)

okay so quick vibe check: this is a system call from the System Calls Manual, and it lives in the Standard C Library aka libc, so you link it with -lc. she's giving REALTIME energy and honestly? obsessed. 🫢


🌸 NAME 🌸

aio_suspend β€” suspend until asynchronous I/O operations or timeout complete (REALTIME)

like... she literally just chills there until your async I/O does its thing. main character behavior fr fr πŸ’…


πŸŽ€ LIBRARY πŸŽ€

Standard C Library (libc, -lc)


✨ SYNOPSIS ✨

#include <aio.h>

int
aio_suspend(const struct aiocb *const iocbs[], int niocb,
    const struct timespec *timeout);

πŸ’– DESCRIPTION πŸ’–

so. the aio_suspend() system call suspends the calling process until at least one of the specified asynchronous I/O requests have completed, a signal is delivered, or the timeout has passed. three ways out, pick your fighter. πŸ‘‘

the iocbs argument is an array of niocb pointers to asynchronous I/O requests. and here's the cute part: array members containing null pointers will be silently ignored. she's not gonna yell at you about it, she just moves on. no cap. πŸ™ˆ

if timeout is not a null pointer, it specifies a maximum interval to suspend. if timeout is a null pointer, the suspend blocks indefinitely β€” like, forever-forever, no take-backs. 😭 and if you wanna effect a poll? make timeout point to a zero-value timespec structure. tiny little peek, no commitment. ✨


⭐ RETURN VALUES ⭐

if one or more of the specified asynchronous I/O requests have completed, aio_suspend() returns 0. slay. πŸŽ‰

otherwise it returns -1 and sets errno to indicate the error, as enumerated below. not slay. πŸ’€


πŸ’œ ERRORS πŸ’œ

the aio_suspend() system call will fail if:

  • [EAGAIN] β€” the timeout expired before any I/O requests completed. bestie the clock ran out and nobody showed up. 😭
  • [EINVAL] β€” the iocbs argument contains more asynchronous I/O requests than the vfs.aio.max_aio_queue_per_proc sysctl(8) variable, or at least one of the requests is not valid. too much going on, or one of them is just... not it. πŸ™…β€β™€οΈ
  • [EINTR] β€” the suspend was interrupted by a signal. rude of that signal honestly. 😀

🌈 SEE ALSO 🌈

the whole girl group. iykyk. πŸ’…


πŸ‘‘ STANDARDS πŸ‘‘

the aio_suspend() system call is expected to conform to the IEEE Std 1003.1 ("POSIX.1") standard. she's certified, she's official, she has paperwork. πŸŽ€


πŸ¦‹ HISTORY πŸ¦‹

the aio_suspend() system call first appeared in FreeBSD 3.0. vintage icon behavior. ⭐


πŸ’Œ AUTHORS πŸ’Œ

This manual page was written by Wes Peters <wes@softweyr.com>. thank you wes, king. 🫢


and that's the whole page, bestie!! this one shipped with Debian and the date on it is Oct 23, 2017 β€” so go forth, suspend responsibly, and remember: timeout = NULL means you're waiting forever, so know what you're signing up for. πŸ’–βœ¨ bye ily!! πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from