Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!ginosko!cs.utexas.edu!uunet!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.wizards Subject: O_NONBLOCK (was: Re: Strange SUN behaviour.) Message-ID: <3790@solo6.cs.vu.nl> Date: 24 Oct 89 01:01:03 GMT References: <218@oasis.mrcu> <219@oasis.mrcu> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 20 yh87@mrcu (Paul Johnson) writes: \... \My program was using fcntl(F_SETFL,...) to set the FNDELAY flag on \descriptor 0 (non-blocking mode). [...] I had assumed \that something like this would be local to the process which set the \flag. [...] I consider this a misfeature too. The worst thing: POSIX 1003.1 seems to bless the sharing of the flag! (The flag is called O_NONBLOCK and its semantics differ slightly from FNDELAY.) This behavior requires the shell to unset the flag after each command (which is what csh does under SunOS [34].x[.y]). Bletch! Whenever a file descriptor is dup(2)ed (possibly implicitly through fork(2)), it should get a *copy* of its parent's O_NONBLOCK (and O_APPEND) flag (possibly copy-on-write). Should I put on my asbestos suit, Doug? -- A symbolic link is a POINTER to a file, | Maarten Litmaath @ VU Amsterdam: a hard link is the file system's GOTO. | maart@cs.vu.nl, mcsun!botter!maart