12 int main(int argc, char *argv[])
14 int fd = open(argv[0], O_RDONLY);
25 /* Get the flags on this FD */
27 if ( (flags = fcntl(fd, F_GETFL)) == -1 ) {
32 if ( flags != (O_RDONLY|O_LARGEFILE) )
33 fprintf(stderr, "flags = %#lx\n", flags);
35 /* Set a lock on this FD */
36 memset(&l, 0, sizeof l);
38 l.l_whence = SEEK_SET;
42 if ( fcntl(fd, F_SETLK, &l) == -1 ) {
47 /* Eventually, fork and try to conflict with this lock... */