Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Locks don't actually work in POSIX in real life anyway.


doesn't opening a file with O_CREAT|O_EXCL work in posix?


POSIX only guarantees advisory locks; mandatory locks are an optional feature and are not supported in Linux. See for example <https://stackoverflow.com/questions/77931997/linux-mandatory...>.


But that is file locking, not lockfiles...

Creating a file with the exclusive creation mode is a pretty common way to make a lock file and as far as I know that works well in posix.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: