[net.sources.bugs] uptime for System V

dlm@cuuxb.UUCP (Dennis L. Mumaugh) (09/24/86)

In article <199@dayton.UUCP> sjm@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