UnifyFS
UnifyFS copied to clipboard
Create documentation page to list differences with posix
For POSIX calls where we differ from standard behavior, we should list those out.
As a first case, our truncate currently does not necessarily first sync a file:
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC); // size = 0
write(fd, 1024)
// ftruncate will sync the given file descriptor before truncating
// so the write will happen and then the file will be truncated
ftruncate(fd, 0); // size = 0
fsync(fd);
However, truncate which takes a path does not fsync the file first:
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC); // size = 0
write(fd, 1024)
truncate(path, 0);
// file at path may end up with size=1024 here,
// since data cached on file descriptor from write
// before truncate is sync'd after the file was truncated
fsync(fd);
Also:
- chmod() and laminate details, including how we laminate files when we copy them in from a non-UnifyFS filesystem to /unifyfs.
- fsync() meaning in a UnifyFS sense
- stat() field oddities and "file size" meanings.