Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: r/w access to fd from creat() Message-ID: <2184@sun.uucp> Date: Wed, 15-May-85 02:58:41 EDT Article-I.D.: sun.2184 Posted: Wed May 15 02:58:41 1985 Date-Received: Fri, 17-May-85 02:46:18 EDT References: <738@plus5.UUCP> Organization: Sun Microsystems, Inc. Lines: 17 > It has been my experience that the file descriptor returned from a > successful invocation of creat() is writaable but not readable, regardless > of the mode specified to creat(). > > Does anybody know of a way to change this (kernel mods are unacceptable)? There isn't any which doesn't involve changing the kernel, except for closing and reopening the file (which won't work in your case). > One problem is that I occasionally need r/w access to a creat()ed fd which > must have a mode of 0444 for exclusive lock purposes. Try using "link" and "unlink" to/from a file for locking purposes; it means the file doesn't have to be unwritable, and also means you can lock out the superuser. Guy Harris