about summary refs log tree commit diff
path: root/src/libnix/pathlocks.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-10-20T09·20+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-10-20T09·20+0000
commit53e376d836133a660223198c7bb8308fb912375e (patch)
tree92d5e5381b9bfafd2a79d3efdec71f14edb798d9 /src/libnix/pathlocks.hh
parent0eab306466fdb186c692521dd1f2b949e56c54da (diff)
* Refactored the source tree.
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 */