merging 4BSD and SysV utilities

Guy Harris guy at sun.uucp
Tue Aug 19 18:11:32 AEST 1986


> One has to maintain two versions of most libraries, since for example the
> data structures included via <stdio.h> differ between the two environments.

Not on my machine, they don't!  Both environments use the 4.3BSD FILE
structure.  The "_flag" is a "short", and includes _IOSTRG; this is
necessary since FILE structures are "malloc"ed except for "stdin", "stdout",
and "stderr" and _NFILE no longer exists (4.3ism).  The "_bufendtab" array
is superfluous, since there's a "_bufsize" element in the FILE structure;
the only reason the USDL didn't stick it in also was probably that they
wanted to allow old ".o" files to be linked with the new library.  Since all
our old ".o" files were built with the 4.[23]BSD structure, this didn't
apply to us.

Most of the code of the standard I/O library actually comes from S5R2,
modified as necessary to work in our environment.  For the few routines that
behave differently, two versions are provided in two different libraries.

Any code written to conform to the SVID will work, since it won't be mucking
with the innards of standard I/O.  Any code that mucks with the innards of
standard I/O is taking its chances; other implementations, now or in the
future, may not have the same innards.

> Another, relatively less severe, drawback to split environments is the
> extra storage space required to maintain two copies of everything.

Then don't maintain two copies of *everything*, just of the stuff that's
incompatibly different.  We supply only one version of most commands.

> but the long-term goal of the UNIX community should be to merge
> the strengths of these environments while gradually leaving their
> weaknesses behind.

Some systems may still have to provide a "4BSD compatiblity library and
command set", for things like old scripts that use "tr" and old programs
that assume "sprintf" returns a pointer to its first argument.  (Neither of
these, BTW, are the direct result of anything Berkeley has done; one version
of AT&T UNIX, namely V7, worked one way, and 4BSD is derived from that.
Both were different in S3 and S5; the first because S3/S5 had the older V6
version, and the second because it was changed from the V7 version.)
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy at sun.com (or guy at sun.arpa)



More information about the Comp.unix.wizards mailing list