fsync is supposed to sync the entire filesystem, yes. On a SD card, I would expect it to do what it says it does.
However, on regular hard drives, filesystem devs and hardware vendors are all incentivized to cheat, since io benchmarks are big and obvious, while dropping data on the floor with power loss or failing hardware is subtle and hard to notice.
However, on regular hard drives, filesystem devs and hardware vendors are all incentivized to cheat, since io benchmarks are big and obvious, while dropping data on the floor with power loss or failing hardware is subtle and hard to notice.
In practice, reliably syncing a file can be surprisingly hard: https://danluu.com/file-consistency/