Method: FFI::Libfuse::FuseOperations#lock
- Defined in:
- lib/ffi/libfuse/fuse_operations.rb
#lock(path, fuse_file_info, cmd, flock) ⇒ Integer
if this method is not implemented, the kernel will still allow file locking to work locally. Hence it
Perform POSIX file locking operation For :f_getlk operation, the library will first check currently held locks, and if a conflicting lock is found it will return information without calling this method. This ensures, that for local locks the pid field is correctly filled in. The results may not be accurate in case of race conditions and in the presence of hard links, but its unlikely that an application would rely on accurate GETLK results in these cases. If a conflicting lock is not found, this method will be called, and the filesystem may fill out l_pid by a meaningful value, or it may leave this field zero.
For :f_setlk and :f_setlkw the pid field will be set to the pid of the process performing the locking operation.
is only interesting for network filesystem and similar.
|
|
# File 'lib/ffi/libfuse/fuse_operations.rb', line 635
|