[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1736801113844434.jpg (25 KB, 355x464)
25 KB JPG
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/
>>
I missed like 2 or 3 days can you redo those
>>
>>108723817
maybe at the end we can have some discussions on audience-requested syscalls
>>
>>108723817
autism
>>
what's the point of these threads
>>
>>108724409
soul
>>
redheads are hot
>>
someone give me a real world example of this being used
>>
>>108724409
molesting syscall anon and discussing syscalls
>>
>>108725008
uwah >_<
>>
>>108723814
>__NR_redhead
heh
>>
>>108723814
I'll read your head
>>
File: 1776789083535607.jpg (328 KB, 1536x2048)
328 KB JPG
>>108724424
>>108727304
oh lol i get it now
yes redheads are cute and molestable
>>
File: mind_blown.gif (2.92 MB, 500x333)
2.92 MB GIF
I recently learned that in 32 bit linux, there is only one syscall for socketcall, and you have to use subcall numbers for things like creating the socket, binding, etc.
>>
>>108727667
teto is not for molesting
but you are
>>
File: images (1).jpg (17 KB, 447x447)
17 KB JPG
>>108723814
>>108723817
i came here for two days and found no syscall of the day
i thought something happened to OP.
>>
>>108727832
Same, I was beginning to get worried.
>>
actually useful to know it exists. thanks OP
>>
>>108727809
i am teto
>>108727832
>>108727839
i make a thread every day. it just dies early sometimes



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.