Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!decvax!decwrl!ucbvax!info-vax From: OC.PEDHEM@CU20B.COLUMBIA.EDU (Guy Talbot) Newsgroups: mod.computers.vax Subject: VAX C 2.0: Open bug and file descriptor docs Message-ID: <12162092967.33.OC.PEDHEM@CU20B.COLUMBIA.EDU> Date: Mon, 25-Nov-85 11:52:01 EST Article-I.D.: CU20B.12162092967.33.OC.PEDHEM Posted: Mon Nov 25 11:52:01 1985 Date-Received: Wed, 27-Nov-85 00:20:59 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 45 Approved: info-vax@sri-kl.arpa > To: ucbvax!@ulysses.UUCP > Subject: Re: Vax C V2.0 open bug > References: <628:H_Eidnes@vax.runit.unit.uninett> > > > > Any program that relies on getting a particular file descriptor at a > > > particular point in its execution is broken. ... > > > > Well, the fact remains that the semantics that you get the > > *lowest free* file descriptor is *documented* in every Unix > > Programming Manual (at least all that I have come across...), > > I have two versions of Unix Programmer's Manuals; one is the 4th > Berkeley Distribution, and the other is from Fortune Systems (For:Pro > is the name they use for their port of Unix). The rule you cite is > not mentioned in the description of the open system call (vol 1, open(2)). > Where, precisely (version, volume, section, page), have you seen this > rule documented? And how, in general, does one know where to look? > > Gary Samuelson > First of all to look for anything use the KWIC (KeyWord-In-Context index) to find anything in UNIX unless you grew up with it. Since I grew up with it (We ran/run UNIX V4, V5, V6, System III,V) at Cooper Union, it seems obvious that the knowledge that you seek is in section II (most low-level system routine are there) under DUP. (I understand how this is not intuitive for most people. Perhaps UNIX needs a massive index volume along the lines of VAX/VMS, [Anybody at A&TTIS listening?]) So see dup (II). I quote: "Dup is used more to reassign the value of file descriptors that to genuinely duplicate a file descriptor. Since the algorithm to allocate file descriptors returns the lowest available value, combinations of dup and close can be used to manipulate file descriptors in a general way. This is handy for manipulating standard input and/or standard output." This was written in the V6 UNIX manual and dated 8/5/73 . Chris Lent Care of OC.PEDHEM@CU20B CUPHOA::LENT (VAXmail) ---- -------