Francesco Biscani schrieb:
What are the implications of doing something like this? Is "sync" going to stop working or isn't it using this function?

sync(8) won't stop working, because it's using sync(2):

% strace -T sync 2>&1 | grep sync
execve("/bin/sync", ["sync"], [/* 20 vars */]) = 0
sync()                                  = 0 <0.213305>


...but can someone explain to me: what's the difference between sync(2) and fsync(2) ? why are there 2 systemcalls, why is fsync(2) expensive and (mis?)used so often by applications and sync(2) is cheap (not?) and used only by sync(8)? the manpages say:

fsync, fdatasync -
        synchronize a file's complete in-core state with that on disk

sync -
        commit buffer cache to disk

but both syscalls do not guarantee data integrity anyway, because "modern disks have large caches".

thank you,
Christian.
--
BOFH excuse #453:

Spider infestation in warm case parts

Reply via email to