1*9653e55fSDavid Xu.\" Copyright (c) 2012 David Xu <davidxu@FreeBSD.org> 2*9653e55fSDavid Xu.\" All rights reserved. 3*9653e55fSDavid Xu.\" 4*9653e55fSDavid Xu.\" Redistribution and use in source and binary forms, with or without 5*9653e55fSDavid Xu.\" modification, are permitted provided that the following conditions 6*9653e55fSDavid Xu.\" are met: 7*9653e55fSDavid Xu.\" 1. Redistributions of source code must retain the above copyright 8*9653e55fSDavid Xu.\" notice, this list of conditions and the following disclaimer. 9*9653e55fSDavid Xu.\" 2. Redistributions in binary form must reproduce the above copyright 10*9653e55fSDavid Xu.\" notice, this list of conditions and the following disclaimer in the 11*9653e55fSDavid Xu.\" documentation and/or other materials provided with the distribution. 12*9653e55fSDavid Xu.\" 13*9653e55fSDavid Xu.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14*9653e55fSDavid Xu.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15*9653e55fSDavid Xu.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16*9653e55fSDavid Xu.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17*9653e55fSDavid Xu.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18*9653e55fSDavid Xu.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19*9653e55fSDavid Xu.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20*9653e55fSDavid Xu.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21*9653e55fSDavid Xu.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22*9653e55fSDavid Xu.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23*9653e55fSDavid Xu.\" SUCH DAMAGE. 24*9653e55fSDavid Xu.\" 25*9653e55fSDavid Xu.\" Portions of this text are reprinted and reproduced in electronic form 26*9653e55fSDavid Xu.\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- 27*9653e55fSDavid Xu.\" Portable Operating System Interface (POSIX), The Open Group Base 28*9653e55fSDavid Xu.\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of 29*9653e55fSDavid Xu.\" Electrical and Electronics Engineers, Inc and The Open Group. In the 30*9653e55fSDavid Xu.\" event of any discrepancy between this version and the original IEEE and 31*9653e55fSDavid Xu.\" The Open Group Standard, the original IEEE and The Open Group Standard is 32*9653e55fSDavid Xu.\" the referee document. The original Standard can be obtained online at 33*9653e55fSDavid Xu.\" http://www.opengroup.org/unix/online.html. 34*9653e55fSDavid Xu.\" 35*9653e55fSDavid Xu.\" $FreeBSD$ 36*9653e55fSDavid Xu.\" 37*9653e55fSDavid Xu.Dd August 21, 2012 38*9653e55fSDavid Xu.Dt PTHREAD_GETCPUCLOCKID 3 39*9653e55fSDavid Xu.Os 40*9653e55fSDavid Xu.Sh NAME 41*9653e55fSDavid Xu.Nm pthread_getcpuclockid 42*9653e55fSDavid Xu.Nd access a thread CPU-time clock 43*9653e55fSDavid Xu.Sh LIBRARY 44*9653e55fSDavid Xu.Lb libpthread 45*9653e55fSDavid Xu.Sh SYNOPSIS 46*9653e55fSDavid Xu.In pthread.h 47*9653e55fSDavid Xu.In time.h 48*9653e55fSDavid Xu.Ft int 49*9653e55fSDavid Xu.Fn pthread_getcpuclockid "pthread_t thread_id" "clockid_t *clock_id" 50*9653e55fSDavid Xu.Sh DESCRIPTION 51*9653e55fSDavid XuThe 52*9653e55fSDavid Xu.Fn pthread_getcpuclockid 53*9653e55fSDavid Xureturns the clock ID of the CPU-time clock of the thread specified by 54*9653e55fSDavid Xu.Fa thread_id . 55*9653e55fSDavid XuIf the thread described by 56*9653e55fSDavid Xu.Fa thread_id 57*9653e55fSDavid Xuexists. 58*9653e55fSDavid Xu.Sh RETURN VALUES 59*9653e55fSDavid XuUpon successful completion, 60*9653e55fSDavid Xu.Fn pthread_getcpuclockid 61*9653e55fSDavid Xureturns zero; otherwise, an error number is returned to indicate the 62*9653e55fSDavid Xuerror. 63*9653e55fSDavid Xu.Sh ERRORS 64*9653e55fSDavid XuThe pthread_getcpuclockid() function will fail if: 65*9653e55fSDavid Xu.Bl -tag -width Er 66*9653e55fSDavid Xu.It Bq Er ESRCH 67*9653e55fSDavid XuThe value specified by 68*9653e55fSDavid Xu.Fa thread_id 69*9653e55fSDavid Xudoes not refer to an existing thread. 70*9653e55fSDavid Xu.El 71*9653e55fSDavid Xu.Sh SEE ALSO 72*9653e55fSDavid Xu.Xr clock_gettime 2 73*9653e55fSDavid Xu.Sh STANDARDS 74*9653e55fSDavid XuThe 75*9653e55fSDavid Xu.Fn pthread_getcpuclockid 76*9653e55fSDavid Xufunction conforms to 77*9653e55fSDavid Xu.St -p1003.1-2004 . 78*9653e55fSDavid Xu.Sh HISTORY 79*9653e55fSDavid XuThe 80*9653e55fSDavid Xu.Fn pthread_getcpuclockid 81*9653e55fSDavid Xufunction first appeared in 82*9653e55fSDavid Xu.Fx 10.0 . 83*9653e55fSDavid Xu.Sh AUTHORS 84*9653e55fSDavid Xu.An David Xu Aq davidxu@FreeBSD.org 85