TL;DR: If the Linux kernel loses a buffered I/O write, is there any way for the application to find out?
I know you have to fsync()
fsync()
Check the return value of close. close can fail whilst buffered writes appear to succeed.