thin wrapper around fcntl(F_SETLK)
A trivial wrapper around
F_SETLKW). Presently allows
a synchronous or asynchronous call to get a whole-file, exclusive, advisory
write lock on a file, or to block until one is possible.
This module has been crafted specifically to work on SmartOS, and may not work anywhere else. Please see fcntl(2) for more details on the locking semantics. In general, the lock will be released when either the file descriptor is closed, or the process exits. The manual page contains information on exceptions to this behaviour.
Will attempt to lock the open file descriptor
fd as described above. Once
the lock is acquired, or an error condition manifests,
callback(err) will be
Synchronous version of
var mod_fs = ;var mod_lockfd = ;var fd = mod_fs;console;console;mod_lockfd;console;/** Do work...*/mod_fs;process;