So I am working with a program written in TCL that uses the FLOCK function to lock files. I am testing it on a newer version of Linux than the one it currently runs on and I found that when the newer machine runs the script, it uses FLOCK from /usr/bin/flock, which differs from the TCL version of FLOCK. The TCL version uses -read -write and such, while the Linux version uses completely different options.
In short, the program stops working and errors out when it gets to any FLOCK call. If I change the options to fit the Linux version, it breaks the program on the other machines.
Is there a way to make it use the TCL version as opposed to the Linux one?
FLOCK
-named things will go through either the kernel'sflock(2)
orfcntl(2)
locking interfaces;flock(2)
is advisory-only and does not work over NFS, sofcntl(2)
was introduced to provide mandatory locks (rarely used) and over-NFS-locking. I suggest reading through theflock(2)
manpage, especially theNOTES
section, for the background that will probably help you better explain the problem you're trying to solve. – sarnold