-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" Modified by Michael Haardt (michael@moria.de)
.\" Modified Sat Jul 24 14:29:17 1993 by Rik Faith (faith@cs.unc.edu)
.\" Added notes on nonstandard behavior: Linux allows 'buf' to
.\" be NULL, but POSIX.1 doesn't specify this and it's nonportable.
.\"
-.TH TIMES 2 2008-06-25 "Linux" "Linux Programmer's Manual"
+.TH TIMES 2 2012-10-22 "Linux" "Linux Programmer's Manual"
.SH NAME
times \- get process times
.SH SYNOPSIS
that the children did not wait for are never seen.
.LP
All times reported are in clock ticks.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
.BR times ()
returns the number of clock ticks that have elapsed since
an arbitrary point in the past.
On error, \fI(clock_t)\ \-1\fP is returned, and
.I errno
is set appropriately.
-.\" The only possible error is EFAULT.
-.SH "CONFORMING TO"
+.SH ERRORS
+.TP
+.B EFAULT
+.I tms
+points outside the process's address space.
+.SH CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001.
.SH NOTES
The number of clock ticks per second can be obtained using:
if the disposition of
.B SIGCHLD
is set to
-.B SIG_IGN
+.BR SIG_IGN ,
then the times of terminated children
are automatically included in the
.I tms_cstime
and
.I tms_cutime
-fields, although POSIX.1-2001 says that this should only happen
-if the calling process
+fields, although POSIX.1-2001 says that this should happen
+only if the calling process
.BR wait (2)s
on its children.
This nonconformance is rectified in Linux 2.6.9 and later.
.BR times ()
just returns a function result.
However, POSIX does not specify this behavior, and most
-other Unix implementations require a non-NULL value for
+other UNIX implementations require a non-NULL value for
.IR buf .
.LP
Note that
On Linux 2.4 and earlier this point is the moment the system was booted.
Since Linux 2.6, this point is \fI(2^32/HZ) \- 300\fP
(i.e., about 429 million) seconds before system boot time.
-This variability across kernel versions (and across Unix implementations),
+This variability across kernel versions (and across UNIX implementations),
combined with the fact that the returned value may overflow the range of
.IR clock_t ,
means that a portable application would be wise to avoid using this value.
To measure changes in elapsed time, use
-.BR gettimeofday (2)
+.BR clock_gettime (2)
instead.
.\" .PP
.\" On older systems the number of clock ticks per second is given
.\" by the variable HZ.
-.SS "Historical"
+.SS Historical
SVr1-3 returns
.I long
and the struct members are of type
(41 seconds) soon after boot when
.BR times ()
can return \-1, falsely indicating that an error occurred.
-The same problem can occur when the return value wraps passed
+The same problem can occur when the return value wraps past
the maximum value that can be stored in
-.BR clockid_t .
+.BR clock_t .
.\" The problem is that a syscall return of -4095 to -1
.\" is interpreted by glibc as an error, and the wrapper converts
.\" the return value to -1.
.\" http://marc.info/?l=linux-kernel&m=119447727031225&w=2
.\" "compat_sys_times() bogus until jiffies >= 0"
.\" November 2007
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR time (1),
.BR getrusage (2),
.BR wait (2),
.BR clock (3),
.BR sysconf (3),
.BR time (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.