13 static void usage(int exval);
14 static void fatal(char *);
17 main(int argc, char **argv)
19 unsigned long start = 0, len = 0;
27 while ((c = getopt(argc, argv, "bhrtw")) != EOF) {
54 if (argc <= 0 || argc > 3)
60 start = atoi(argv[1]);
66 if ((fd = open(fname, O_RDWR, 0644)) < 0)
69 /* printf("TP1\n"); */
75 if (fcntl(fd, cmd, &fl) < 0)
77 printf("fcntl: ok\n");
79 /* printf("TP2\n"); */
81 if (fl.l_type == F_UNLCK) {
82 printf("%s: no conflicting lock\n", fname);
84 printf("%s: conflicting lock by %d on (%ld;%ld)\n",
85 fname, fl.l_pid, fl.l_start, fl.l_len);
90 /* printf("TP3\n"); */
98 fprintf(stderr, "usage: testlk filename [start [len]]\n");