3 ms·
doesn't opening a file with O_CREAT|O_EXCL work in posix?
by procaryote 1y ago
doesn't opening a file with O_CREAT|O_EXCL work in posix?
- wpollock 1y agoPOSIX 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-locking-for-file-locking https://stackoverflow.com/questions/77931997/linux-mandatory...>.
- procaryote 1y agoBut 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.