Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!usc!ucsd!ames!sgi!shinobu!odin!lavalite.asd.sgi.com!rlb From: rlb@lavalite.asd.sgi.com (Robert Brown) Newsgroups: comp.sys.sgi Subject: Re: Silly error with flock Message-ID: <1991Jan9.163014.2637@odin.corp.sgi.com> Date: 9 Jan 91 16:30:14 GMT References: <1991Jan9.030948.18665@ccu1.aukuni.ac.nz> Sender: news@odin.corp.sgi.com (Net News) Reply-To: rlb@lavalite.asd.sgi.com (Robert Brown) Distribution: comp Organization: Silicon Graphics, Inc., Mountain View, CA. Lines: 21 On the bottom of my copy of the flock manual page is the following: Unlike BSD flock(2), attempts to acquire an exclusive lock on an fd opened for reading but not writing will fail with EBADF, as will attempts to acquire a shared lock on a write-only fd. Also, your test if ( lock <= 0) perror("open"); should be if ( lock < 0) perror("open"); but that's unrelated to the condition you asked about Hope that helps! Bob Brown ------------------------------------------------------------------ Silicon Graphics, Inc. Advanced Systems Division