Thread #108292753
File: 1687829191911161.png (9.1 KB)
9.1 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 manman 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/
14 RepliesView Thread
>>
File: chiyo;yotsuba:caption:intel inside.jpg (96.4 KB)
96.4 KB JPG
>>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).
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>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 :<
>>
>>
>>108296183
demand draft
https://en.wikipedia.org/wiki/Demand_draft