Whamcloud - gitweb
Landing the mds_lock_devel branch on the trunk. Notables:
[fs/lustre-release.git] / lustre / tests / toexcl.c
diff --git a/lustre/tests/toexcl.c b/lustre/tests/toexcl.c
new file mode 100644 (file)
index 0000000..da13217
--- /dev/null
@@ -0,0 +1,24 @@
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+
+int main(int argc, char **argv)
+{
+        int rc;
+
+        if (argc != 2) { 
+                printf("usage: %s name\n", argv[0]);
+                return 1;
+        }
+
+        rc = open(argv[1], O_CREAT|O_EXCL, 0644);
+        if (rc == -1)
+                printf("open failed: %s\n", strerror(errno));
+        else
+                printf("open success.\n");
+        return 0;
+}