about summary refs log tree commit diff
path: root/src/libstore/pathlocks.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-11-18T10·55+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-11-18T10·55+0000
commit9f0f020929c9e093405cc6193d2f227cab763912 (patch)
tree833aad12f6db91e77ff2fb47a2bcb54a0ea9d89f /src/libstore/pathlocks.hh
parent8798fae30450a88c339c8f23d7e0c75f5df2ef1c (diff)
* libnix -> libstore.
Diffstat (limited to 'src/libstore/pathlocks.hh')
-rw-r--r--src/libstore/pathlocks.hh24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libstore/pathlocks.hh b/src/libstore/pathlocks.hh
new file mode 100644
index 000000000000..ce61386d6df0
--- /dev/null
+++ b/src/libstore/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 */