11 static void usage(int exval);
12 static void fatal(char *);
15 main(int argc, char **argv)
17 unsigned long start = 0, len = 0;
25 while ((c = getopt(argc, argv, "bhrtw")) != EOF) {
52 if (argc <= 0 || argc > 3)
58 start = atoi(argv[1]);
64 if ((fd = open(fname, O_RDWR, 0644)) < 0)
67 /* printf("TP1\n"); */
73 if (fcntl(fd, cmd, &fl) < 0)
75 printf("fcntl: ok\n");
77 /* printf("TP2\n"); */
79 if (fl.l_type == F_UNLCK) {
80 printf("%s: no conflicting lock\n", fname);
82 printf("%s: conflicting lock by %d on (%ld;%ld)\n",
83 fname, fl.l_pid, fl.l_start, fl.l_len);
88 /* printf("TP3\n"); */
96 fprintf(stderr, "usage: testlk filename [start [len]]\n");