3 ms·
>fcntl(fd, F_GETLK, &lock), fcntl(fd, F_SETLK, &lock), and fcntl(fd, F_SETLKW, &lock) There's also `flock`, the CLI utility in util-linux, that allows using fl
by Igrom 9mo ago
>fcntl(fd, F_GETLK, &lock), fcntl(fd, F_SETLK, &lock), and fcntl(fd, F_SETLKW, &lock)
There's also `flock`, the CLI utility in util-linux, that allows using flocks in shell scripts.
- cachius 9mo agoWhat are flocks in this context? Surely not a number of sheep...
- pjmlp 9mo agoIn UNIX/POSIX file locks are advisory, not enforced, it only works if all processes play ball.
- zbentley 9mo agoSure, but the discussion is around whether they’re atomic, not whether they’re advisory.
- zbentley 9mo agoAren’t flock and POSIX locks backed by totally different systems?
- zbentley 9mo agoToo late to edit, but it appears that they are per this comment on a different article and the documentation it references: https://news.ycombinator.com/item?id=46607265 https://news.ycombinator.com/item?id=46607265