[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: 1687829191911161.png (9 KB, 658x673)
9 KB
9 KB PNG
previous: >>108285124

#define __NR_fsync                74
#define __NR_fdatasync 75

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

tl;dr:
flush file data to disk

the tl;dr honestly covers pretty much all of it for this one, lol. i guess it's maybe interesting that it blocks? plus the option for metadata-less flushes
i guess the one other thing worth mentioning is the EIO error case, where you can get some write-like errors when trying to flush
i'm sure these are useful to someone trying to do optimizations, but they're not something i've ever taken advantage of

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/
>>
>>108292753
guess it can be useful for synchronization in some rare cases for network filesystems like NFS?
NFS by default uses async writes, data is flushed on close() of fsync(). Say you open a file and never close it. You continuously write to it on NFS client and expect to read it immediately on the server or another client, you could use fsync() for that.
Some shitty FUSE filesystems don't implement flush on fsync() (or even close() for that matter, muh "caching"), which leads to all sorts of synchronization issues (write and close a file, yet the changes aren't commited to the storage yet).
>>
bampu
>>
>>108292753
>pic
That's from the "OL has to wake up and go to work" set, right? Saucenao is garbage these days.
>>
Remember to do a sync everytime you do a dd, kids!
>>
Penis water tap lmao
>>
>>108292753
Bump.
>>
>>108294022
>dd
what's a dd?
>>
>>108296183
Dick Destroyer.
>>
>>108296183
It's the most based way to copy information. It is more commonly used to completely wipe hard drives, because if you type a command even slightly wrong, that's what you do.
>>
>>108292753
oh no why is shy crying
>>
>>108297413
i use it for formatting iso files onto USB drives
>>108293395
no idea sorry
>>108297465
because people don't post in her syscall threads :<
>>
bampu
>>
>>108297887
Just cp distro.iso /dev/sdb
dd is placebo
>>
>>108296183
demand draft
https://en.wikipedia.org/wiki/Demand_draft



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