Bizzare Bourne Shell (well, not really)

Dan Strick dan at idis.UUCP
Thu May 17 12:55:08 AEST 1984


I looked up the V6, V7, and 4.0bsd (~32V) manual pages for the
break system call and found that all mention the fact that the
break address is rounded up and none mention the fact that new
memory is cleared.

I assume the unix support group changed the manual page to eliminate
a machine dependency (the rounding) and to make the documentation
more complete (clearing new memory).  These kind of changes to
documentation are always good.  Right?  Wrong!
New memory is cleared not so much to save the programmer the trouble
of clearing it explicitly but to avoid apparently randomly malfunctioning
programs and possibly as a slightly paranoid security measure.
It would have made as much sense to set new virtual memory locations
to -1.  Some features are best left undocumented or hidden in a footnote.
(especially obviously implementation dependent features)

The old manual pages give the rules for rounding up break addresses
on each of the various machines that unix ran on at the time that those
old versions of unix were released.  This had to go, but it would
have made sense to mention that the system did not always take requested
break addresses literally.  Some features are best left documented.
(especially when omission is misleading)

My opinions: the unix implementation of the brk() system call is
correct.  Recent documentation (i.e. system 5) may be misleading
(so much for professionally designed user friendly documentation).
The Bourne shell implementation (which motivated the tirade about
the unix brk() implementation) is sick.  It breaks all the rules.
Worse: it uses longjumps.

				Dan Strick
				[decvax|mcnc]!idis!dan



More information about the Comp.os.eunice mailing list