summaryrefslogtreecommitdiff
path: root/lib/libpthread/man/pthread_getcpuclockid.3
blob: fae9aaaa99300ce08b9d5e8f1298dc72dc5237f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.\"	$OpenBSD: pthread_getcpuclockid.3,v 1.2 2014/11/30 21:35:46 schwarze Exp $
.\"
.\" Copyright (c) 2013 Philip Guenther <guenther@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: November 30 2014 $
.Dt PTHREAD_GETCPUCLOCKID 3
.Os
.Sh NAME
.Nm pthread_getcpuclockid
.Nd get a clock measuring thread CPU time
.Sh SYNOPSIS
.Fd #include <pthread.h>
.Ft int
.Fn pthread_getcpuclockid "pthread_t thread" "clockid_t *clock_id"
.Sh DESCRIPTION
The
.Fn pthread_getcpuclockid
function allows the calling thread to get a
.Vt clockid_t
value that measures the time spent by CPUs running in user or kernel mode
on behalf of the thread specified by
.Fa thread .
.Sh RETURN VALUES
If successful,
.Fn pthread_getcpuclockid
will return zero.
Otherwise an error number will be returned to indicate the error.
.Sh ERRORS
.Fn pthread_getcpuclockid
will fail if:
.Bl -tag -width Er
.It Bq Er ESRCH
thread is an invalid thread ID.
.El
.Sh SEE ALSO
.Xr clock_gettime 2 ,
.Xr clock_getcpuclockid 3
.Sh STANDARDS
The
.Fn pthread_getcpuclockid
function conforms to
.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn pthread_getcpuclockid
function first appeared in IEEE Std 1003.1d-1999
.Pq Dq POSIX.1d
and has been available since
.Ox 5.4 .