clock_t now;
int fl;
int a_flag, n_flag, v_flag;
+ struct tms tmsbuf;
getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz);
}
now= uptime.tv_sec * HZ + (uptime.tv_usec*HZ/1000000);
#else /* Minix 3 */
- now= times(NULL);
+ now= times(&tmsbuf);
#endif
for (i= 0; i<TCP_CONN_NR; i++)
clock_t now;
int fl;
int a_flag, n_flag;
+ struct tms tmsbuf;
(prog_name=strrchr(argv[0], '/')) ? prog_name++ : (prog_name=argv[0]);
}
now= uptime.tv_sec * HZ + (uptime.tv_usec*HZ/1000000);
#else /* Minix 3 */
- now= times(NULL);
+ now= times(&tmsbuf);
#endif
for (i= 0; i<UDP_FD_NR; i++)
for the current process
and for the terminated child processes
of the current process.
-All times are in 1/CLOCKS_PER_SEC seconds.
+All times are in system clock ticks.
.PP
This is the structure returned by
.BR times :
their children's times.
.SH RETURN
.B Times
-returns 0 on success, otherwise \-1 with the error code stored into the
+returns the number of system clock ticks since boot time on success,
+otherwise \-1 with the error code stored into the
global variable
.BR errno .
+Since \-1 is also a valid return value upon success, one should clear
+.B errno
+before calling this function, and if \-1 is returned,
+check its value again afterwards.
.SH ERRORS
The following error code may be set in
.BR errno :