You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On NFS, O_EXCL is only supported when using NFSv3 or later on kernel 2.6 or later. In NFS environments where O_EXCL support is not provided, programs that rely on it for performing locking tasks will contain a race condition. Portable programs that want to perform atomic file locking using a lockfile, and need to avoid reliance on NFS support for O_EXCL, can create a unique file on the same file system (e.g., incorporating hostname and PID), and use link(2) to make a link to the lockfile. If link(2) returns 0, the lock is successful. Otherwise, use stat(2) on the unique file to check if its link count has increased to 2, in which case the lock is also successful.
I say no, since this has been available since June 1995, and the lockfile mechanism is necessarily always best-effort anyways (especially if you get the network involved).
I say no, since this has been available since June 1995, and the lockfile mechanism is necessarily always best-effort anyways (especially if you get the network involved).
source: O_EXCL https://linux.die.net/man/2/open
The text was updated successfully, but these errors were encountered: