logoalt Hacker News

Igromyesterday at 9:44 AM3 repliesview on HN

>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.


Replies

cachiusyesterday at 9:49 AM

What are flocks in this context? Surely not a number of sheep...

show 2 replies
pjmlpyesterday at 2:14 PM

In UNIX/POSIX file locks are advisory, not enforced, it only works if all processes play ball.

show 1 reply
zbentleyyesterday at 3:58 PM

Aren’t flock and POSIX locks backed by totally different systems?