#include <stat.h> question answered

Guy Harris guy at rlgvax.UUCP
Tue Nov 8 02:19:34 AEST 1983


While we're on the subject of include files "moved" between /usr/include and
/usr/include/sys, why is there a "time.h" in /usr/include/sys on Berkeley
systems and why do people include "sys/time.h"?  This file contains *only*
the definition of a "struct tm", which is only used by the routines associated
with "ctime" (like "localtime") and is not used *anywhere* in the 4.1 kernel
that I could see.  It *is* used in the 4.1c/4.2 kernel.  However, there are
*user mode* programs which include "sys/time.h", and these programs don't
compile on non-Berkeley systems unless you change the "sys/time.h" to "time.h".
Since "time.h" and "sys/time.h" are identical on 4.1 and "time.h" is a
symbolic link to "sys/time.h" on 4.2, it would make no difference when compiled
on Berkeley systems if it included "time.h", and it would at least compile
on non-Berkeley systems.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.unix.wizards mailing list