[mod.computers.vax] VAX C 2.0: Open bug and file descriptor docs

OC.PEDHEM@CU20B.COLUMBIA.EDU (Guy Talbot) (11/25/85)

> 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)
----

-------