Linux常用api
unistd.h¶
usleep()
mkstemp() 创建临时文件
POSIX的fsync/sync等命令的区别¶
via: https://stackoverflow.com/questions/48171855/what-is-the-difference-between-fsync-and-syncfs
- POSIX
fsync()
: "please write data for this file to disk"- POSIX
sync()
: "write all data to disk when you get around to it"- Linux
sync()
: "write all data to disk (when you get around to it?)"- Linux
syncfs()
: "write all data for the filesystem associated with this file to disk (when you get around to it?)"- Linux
fsync()
: "write all data and metadata for this file to disk, and don't return until you do"