Create documentation page to list differences with posix
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 122
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
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);
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the repository's existing documentation pages and reviewing the POSIX truncate and ftruncate examples given in this issue. The work is done when a documentation page lists the relevant differences from POSIX and records the described truncate behavior accurately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100