Xref: utzoo comp.unix.questions:12823 comp.lang.c:17614 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!husc6!rutgers!att!homxb!homxc!iluvu From: iluvu@homxc.ATT.COM (S.RAVIKUMAR) Newsgroups: comp.unix.questions,comp.lang.c Subject: lockfile/unix/c Keywords: c, unix, lockf Message-ID: <6307@homxc.ATT.COM> Date: 12 Apr 89 21:26:32 GMT Organization: AT&T BL Holmdel NJ USA Lines: 14 I tried to restrict access to a shared resource between processes using the unix system call "lockf". The piece of code is as follows: fd = open(FILENAME, O_CREAT, 0666); lockf(fd, F_LOCK, (long)0); "lockf" always returns with an error and errno is set to "Bad file descriptor". Any help or suggestions are welcome. Thanks. --ravi skumar@hocus.att.com