int VCSAgLockFile(const char *fname, VCSAgLockType ltype, VCSAgBlockingType btype, VCSAgErrnoType *errp)
Get a read or write (that is, shared or exclusive) lock on the given file. Both blocking and non-blocking modes are supported. Returns 0 if the lock could be obtained, or returns VCSAgErrWouldBlock if non-blocking is requested and the lock is busy. Otherwise returns -1. Each thread is considered a distinct owner of locks.
Mt-safe; deferred cancel safe.