[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: Tumblr_l_78011383013885.jpg (616 KB, 2048x1796)
616 KB JPG
previous: >>108805935

#define __NR_fadvise64                221

https://man7.org/linux/man-pages/man2/fadvise64.2.html

tl;dr:
advise the kernel as to how you plan to access a file

this is kind of gross:
              The implementation may attempt to write back dirty pages in
the specified region, but this is not guaranteed. Any
unwritten dirty pages will not be freed. If the
application wishes to ensure that dirty pages will be
released, it should call fsync(2) or fdatasync(2) first.

either write them back, or else discard them all. don't tell me they may or may not get written back. the indeterminism is frightening

not something i've ever had occasion to use, but i can see where it would be useful

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/
>>
$500 say the nondeterminism (that's the word you managed to molest) is caused by caches not being retired to memory.
>>
>>108813706
is that the word? it doesn't sound right
i know things can be nondeterministic, but i feel like with the -ism, it should have an in-
maybe i'm just overthinking it though
>>
>>108813951
no, now that i think about it, i guess it should be nondeterminism
i was just being silly
>>
I advise this thread to return to page 1.
>>
>indeterminism is frightening
you don't use it for correctness issues, only for when you see a clear improvement in benchmarks by the kernel behaving less retardedly
>>
>>108815088
i guess that's fair enough
>>
>>108813613
>or until the end of the file if len is 0
god, this is exactly the convenience behaviour I wish many of the file syscalls had. I loathe the constant fstatting, and I usually don't even handle TOCTOU
>>
>>108813613
POSIX permits the implementation to do anything or nothing at all in response to the advise functions, so you should never rely on them if there's some very specific behavior you want. They're purely for optimization hinting.
>>
POSIX was a mistake. They should've just let UNIX die.



[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.