#pragma once #include "types.hh" namespace nix { /* Open (possibly create) a lock file and return the file descriptor. -1 is returned if create is false and the lock could not be opened because it doesn't exist. Any other error throws an exception. */ int openLockFile(const Path & path, bool create); /* Delete an open lock file. */ void deleteLockFile(const Path & path, int fd); enum LockType { ltRead, ltWrite, ltNone }; bool lockFile(int fd, LockType lockType, bool wait); class PathLocks { private: typedef std::pair FDPair; list fds; bool deletePaths; public: PathLocks(); PathLocks(const PathSet & paths, const string & waitMsg = ""); bool lockPaths(const PathSet & _paths, const string & waitMsg = "", bool wait = true); ~PathLocks(); void unlock(); void setDeletion(bool deletePaths); }; bool pathIsLockedByMe(const Path & path); } tr>Wojtek's customized Guix
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2024-07-19gnu: nsncd: Remove duplicate definition....Efraim Flashner
2024-07-19gnu: rust-slog-async-2: Update to 2.8.0....Efraim Flashner
2024-06-02gnu: Add nsncd....Picnoir
2024-05-29gnu: nss/fixed: Hasten test suite....Maxim Cournoyer
2024-05-13gnu: nss/fixed: Tweak performance test....Christopher Baines
2024-04-28gnu: nss/fixed: Update to 3.99....Ian Eure
2024-04-26gnu: nss: Graft with version 3.98 [security fixes]....Maxim Cournoyer
2024-04-26gnu: nss-3.98: Streamline source origin via inheritance....Maxim Cournoyer
2024-04-24gnu: nss: Fix cross-compilation....Zheng Junjie
2024-04-24gnu: nspr: Fix cross-compilation....Zheng Junjie
2024-04-12gnu: Add nss-3.98....Ian Eure