uptime for System V

Dennis L. Mumaugh dlm at cuuxb.UUCP
Thu Sep 25 05:07:34 AEST 1986


In article <199 at dayton.UUCP> sjm at dayton.UUCP (Steven J. McDowall) writes:
> *	uptime.c -- Print how long the system has been up 
> *				System V Implmenentation
> *
> *	9/19/86 - Version 1.1
....
>	uptime = (times(tbuf) / HZ);
>
New C compilers have  the  ability  to  pass  structures  on  the
argument of a function.  Times requires a pointer to a structure.
Thus
>	uptime = (times(&tbuf) / HZ);
is correct.  The second  code  is  correct  no  matter  what  the
compiler.

I just talked with Paul and we agree.  His worked because he used
a trick and had an array instead of a structure.
-- 
=Dennis L. Mumaugh
 Lisle, IL       ...!ihnp4!cuuxb!dlm



More information about the Comp.sources.bugs mailing list