Skip to content

posix

1 post with the tag “posix”

The Syscalls That Lie

The EINTR retry, the fsync that isn't, and the one call you must never retry.

The POSIX calls at the bottom of every server are not as honest as they look. A read can be cut short by a signal and return having done nothing wrong. An fsync on macOS returns success without actually putting your data on the platter. And retrying a close() that was interrupted can silently destroy a file descriptor another thread just reused. The eighteenth familiar is the thin layer that knows all of this and does the boring, correct thing so the rest of the engine never has to.