Finita la conversione dei listati in file separati. Passato anche alla nuova
[gapil.git] / listati / LockFile.c
diff --git a/listati/LockFile.c b/listati/LockFile.c
new file mode 100644 (file)
index 0000000..7cd07d3
--- /dev/null
@@ -0,0 +1,17 @@
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>                               /* unix standard functions */
+/*
+ * Function LockFile:
+ */
+int LockFile(const char* path_name)
+{
+    return open(path_name, O_EXCL|O_CREAT);
+}
+/*
+ * Function UnlockFile:
+ */
+int UnlockFile(const char* path_name) 
+{
+    return unlink(path_name);
+}