9 /* Open (possibly create) a lock file and return the file descriptor.
10 -1 is returned if create is false and the lock could not be opened
11 because it doesn't exist. Any other error throws an exception. */
12 int openLockFile(const Path
& path
, bool create
);
14 /* Delete an open lock file. */
15 void deleteLockFile(const Path
& path
, int fd
);
17 enum LockType
{ ltRead
, ltWrite
, ltNone
};
19 bool lockFile(int fd
, LockType lockType
, bool wait
);
25 typedef std::pair
<int, Path
> FDPair
;
31 PathLocks(const PathSet
& paths
,
32 const string
& waitMsg
= "");
33 bool lockPaths(const PathSet
& _paths
,
34 const string
& waitMsg
= "",
38 void setDeletion(bool deletePaths
);
42 bool pathIsLockedByMe(const Path
& path
);