previous: >>108715477
#define __NR_readahead 187
https://man7.org/linux/man-pages/man2/readahead.2.html
tl;dr:
load a file into your cache
pretty neat syscall. honestly seems quite handy if you need the performance for whatever reason. a few notes, though. it's a bit interesting that it only returns 0 on success (and not e.g., the number of bytes to be read), but i guess that's just because it's meant to be nonblocking, so that would kind of defeat the purpose. just breaks with the pattern of other read-like syscalls, though. speaking of nonblocking, this is pretty amusing
BUGS
readahead() attempts to schedule the reads in the background and
return immediately. However, it may block while it reads the
filesystem metadata needed to locate the requested blocks. This
occurs frequently with ext[234] on large files using indirect
blocks instead of extents, giving the appearance that the call
blocks until the requested data has been read.
not much more to say, really, i guess. it's a relatively simple, but seemingly useful, syscall. i give it my seal of approval. what do you think, anon?
relevant resources:
man man
man syscalls
https://man7.org/linux/man-pages/
https://linux.die.net/man/
https://elixir.bootlin.com/linux/
https://elixir.bootlin.com/musl/
https://elixir.bootlin.com/glibc/