4.2BSD ctime() arguments - (nf)

olson at fortune.UUCP olson at fortune.UUCP
Thu Apr 12 10:17:31 AEST 1984


#R:noscvax:-39800:fortune:11600085:000:876
fortune!olson    Apr 11 12:39:00 1984

>	Is it safe to use a *int as the argument to gmtime() instead of
>	a *long.

The answer is yes on machines that have 32bit ints, but the code won't
be portable to machines that have 16bit ints.

The BSD (and for that matter V7 and S3) man pages and include files
are full of this kind of carelessness.  BSD especially is guilty of
referring to 'words' sometimes meaning shorts and sometimes meaning
longs.

One of the classic cases is the wait(2) man page referring to
the high byte and the low byte, when actually it is the low order byte
and the 'next to low' order byte.  (Also see some of the ioctls under
tty(4).)  Some of the man pages were not rewritten from the V7,
and other man pages were written with the (unstated) assumption that
they were for the VAX.

	Dave Olson, Fortune Systems
	UUCP: {ihnp4,ucbvax!amd70}!fortune!olson
	ARPA: amd70!fortune!olson at BERKELEY



More information about the Comp.unix.wizards mailing list