#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); } td class='sub'>Wojtek's customized Guix
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2020-06-28tests: Do not fail when network interface aliases are present....Marius Bakke
2020-06-05tests: syscall: Support file-systems without extended attributes....Mathieu Othacehe
2020-06-02tests: Allow passing on systems without support for swap devices....Simon South
2020-05-14syscalls: Add 'getxattr'....Jan (janneke) Nieuwenhuizen
2020-02-11syscalls: Re-enable 'pivot-root' test....Ludovic Courtès
2019-10-05syscalls: Add 'add-to-entropy-count'....Ludovic Courtès
2019-06-27syscalls: Add 'terminal-rows'....Ludovic Courtès
2018-07-03syscalls: Define AT_SYMLINK_NOFOLLOW et al....Ludovic Courtès
2018-04-08tests: Skip 'pivot-root' test on Ubuntu's 4.4 kernels....Ludovic Courtès
2017-11-25syscalls: Adjust utmpx test....Ludovic Courtès
2017-07-12syscalls: Add network-interface-running?...Danny Milosavljevic
2017-06-16syscalls: Add 'scandir*'....Ludovic Courtès
2017-05-28syscalls: Add 'thread-name' and 'set-thread-name'....Ludovic Courtès
2017-02-11tests: Relax test on utmpx entries....Ludovic Courtès
2017-01-31tests: Really skip /var/run/utmpx test when needed....Paul Garlick