Method Fuse.Operations()->lock()
- Method
lock
mapping(string:int)|intlock(stringpath,intmode,mapping(string:int)how)- Description
Lock, unlock or test for the existence of record locks (POSIX file locking). The owner of the lock is identified by
how->ownerIf you only need local file-locking on the computer the filesystem is mounted on you do not need to implement this interface. This is only needed for network filesystems that want locking to work over the network.
The operation mode depends on the
modeargument.F_SETLKAcquire a lock (when
how->typeis F_RDLCK or F_WRLCK) or release a lock (whenhow->typeis F_UNLCK) on the bytes specified by thehow->whence,how->start, andhow->lenfields of lock. If a conflicting lock is held by another process, you should return System.EACCES or System.EAGAIN.F_SETLKWIdentical to SETLK, but if a lock is held on the file, wait for it to be released before returning. You are allowed to return EINTR, to signal that the waiting has been interrupted and must be restarted.
F_GETLKIdentical to SETLK, but do not actually aquire the lock if it can be aquired. If one or more incompatible locks would prevent this lock being placed, then
fcntl()returns details about one of these locks in the"type","whence",start, and"len"fields ofhowand sets the"pid"field to be the PID of the process holding that lock. Then return the mapping.