1*ec5cd23eSschwarze.\" $OpenBSD: pthread_getcpuclockid.3,v 1.3 2015/09/10 17:55:21 schwarze Exp $ 27b36c281Sguenther.\" 37b36c281Sguenther.\" Copyright (c) 2013 Philip Guenther <guenther@openbsd.org> 47b36c281Sguenther.\" 57b36c281Sguenther.\" Permission to use, copy, modify, and distribute this software for any 67b36c281Sguenther.\" purpose with or without fee is hereby granted, provided that the above 77b36c281Sguenther.\" copyright notice and this permission notice appear in all copies. 87b36c281Sguenther.\" 97b36c281Sguenther.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 107b36c281Sguenther.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 117b36c281Sguenther.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 127b36c281Sguenther.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 137b36c281Sguenther.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 147b36c281Sguenther.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 157b36c281Sguenther.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 167b36c281Sguenther.\" 17*ec5cd23eSschwarze.Dd $Mdocdate: September 10 2015 $ 187b36c281Sguenther.Dt PTHREAD_GETCPUCLOCKID 3 197b36c281Sguenther.Os 207b36c281Sguenther.Sh NAME 217b36c281Sguenther.Nm pthread_getcpuclockid 227b36c281Sguenther.Nd get a clock measuring thread CPU time 237b36c281Sguenther.Sh SYNOPSIS 24*ec5cd23eSschwarze.In pthread.h 257b36c281Sguenther.Ft int 267b36c281Sguenther.Fn pthread_getcpuclockid "pthread_t thread" "clockid_t *clock_id" 277b36c281Sguenther.Sh DESCRIPTION 287b36c281SguentherThe 297b36c281Sguenther.Fn pthread_getcpuclockid 307b36c281Sguentherfunction allows the calling thread to get a 317b36c281Sguenther.Vt clockid_t 327b36c281Sguenthervalue that measures the time spent by CPUs running in user or kernel mode 337b36c281Sguentheron behalf of the thread specified by 347b36c281Sguenther.Fa thread . 357b36c281Sguenther.Sh RETURN VALUES 367b36c281SguentherIf successful, 377b36c281Sguenther.Fn pthread_getcpuclockid 387b36c281Sguentherwill return zero. 397b36c281SguentherOtherwise an error number will be returned to indicate the error. 407b36c281Sguenther.Sh ERRORS 417b36c281Sguenther.Fn pthread_getcpuclockid 427b36c281Sguentherwill fail if: 437b36c281Sguenther.Bl -tag -width Er 447b36c281Sguenther.It Bq Er ESRCH 457b36c281Sguentherthread is an invalid thread ID. 467b36c281Sguenther.El 477b36c281Sguenther.Sh SEE ALSO 487b36c281Sguenther.Xr clock_gettime 2 , 497b36c281Sguenther.Xr clock_getcpuclockid 3 507b36c281Sguenther.Sh STANDARDS 517b36c281SguentherThe 527b36c281Sguenther.Fn pthread_getcpuclockid 537b36c281Sguentherfunction conforms to 547b36c281Sguenther.St -p1003.1-2008 . 557b36c281Sguenther.Sh HISTORY 567b36c281SguentherThe 577b36c281Sguenther.Fn pthread_getcpuclockid 58d982c941Sschwarzefunction first appeared in IEEE Std 1003.1d-1999 59d982c941Sschwarze.Pq Dq POSIX.1d 607b36c281Sguentherand has been available since 617b36c281Sguenther.Ox 5.4 . 62