about summary refs log tree commit diff
path: root/src/libnix/pathlocks.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnix/pathlocks.hh')
-rw-r--r--src/libnix/pathlocks.hh24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libnix/pathlocks.hh b/src/libnix/pathlocks.hh
new file mode 100644
index 000000000000..ce61386d6df0
--- /dev/null
+++ b/src/libnix/pathlocks.hh
@@ -0,0 +1,24 @@
+#ifndef __PATHLOCKS_H
+#define __PATHLOCKS_H
+
+#include "util.hh"
+
+
+typedef enum LockType { ltRead, ltWrite, ltNone };
+
+bool lockFile(int fd, LockType lockType, bool wait);
+
+
+class PathLocks 
+{
+private:
+    list<int> fds;
+    Paths paths;
+
+public:
+    PathLocks(const PathSet & _paths);
+    ~PathLocks();
+};
+
+
+#endif /* !__PATHLOCKS_H */