Whamcloud - gitweb
da13217115708b4c2f957152160de7d69937e3fb
[fs/lustre-release.git] / lustre / tests / toexcl.c
1 #include <sys/types.h>
2 #include <sys/stat.h>
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <fcntl.h>
6 #include <errno.h>
7 #include <string.h>
8
9 int main(int argc, char **argv)
10 {
11         int rc;
12
13         if (argc != 2) { 
14                 printf("usage: %s name\n", argv[0]);
15                 return 1;
16         }
17
18         rc = open(argv[1], O_CREAT|O_EXCL, 0644);
19         if (rc == -1)
20                 printf("open failed: %s\n", strerror(errno));
21         else
22                 printf("open success.\n");
23         return 0;
24 }