xref: /freebsd/share/man/man3/pthread_getcpuclockid.3 (revision eb6a43424327968297b8d983bb7f7774d6fa8f16)
19653e55fSDavid Xu.\" Copyright (c) 2012 David Xu <davidxu@FreeBSD.org>
29653e55fSDavid Xu.\" All rights reserved.
39653e55fSDavid Xu.\"
49653e55fSDavid Xu.\" Redistribution and use in source and binary forms, with or without
59653e55fSDavid Xu.\" modification, are permitted provided that the following conditions
69653e55fSDavid Xu.\" are met:
79653e55fSDavid Xu.\" 1. Redistributions of source code must retain the above copyright
89653e55fSDavid Xu.\"    notice, this list of conditions and the following disclaimer.
99653e55fSDavid Xu.\" 2. Redistributions in binary form must reproduce the above copyright
109653e55fSDavid Xu.\"    notice, this list of conditions and the following disclaimer in the
119653e55fSDavid Xu.\"    documentation and/or other materials provided with the distribution.
129653e55fSDavid Xu.\"
139653e55fSDavid Xu.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
149653e55fSDavid Xu.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
159653e55fSDavid Xu.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
169653e55fSDavid Xu.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
179653e55fSDavid Xu.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
189653e55fSDavid Xu.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
199653e55fSDavid Xu.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
209653e55fSDavid Xu.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
219653e55fSDavid Xu.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
229653e55fSDavid Xu.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
239653e55fSDavid Xu.\" SUCH DAMAGE.
249653e55fSDavid Xu.\"
259653e55fSDavid Xu.\" Portions of this text are reprinted and reproduced in electronic form
269653e55fSDavid Xu.\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology --
279653e55fSDavid Xu.\" Portable Operating System Interface (POSIX), The Open Group Base
289653e55fSDavid Xu.\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of
299653e55fSDavid Xu.\" Electrical and Electronics Engineers, Inc and The Open Group.  In the
309653e55fSDavid Xu.\" event of any discrepancy between this version and the original IEEE and
319653e55fSDavid Xu.\" The Open Group Standard, the original IEEE and The Open Group Standard is
329653e55fSDavid Xu.\" the referee document.  The original Standard can be obtained online at
339653e55fSDavid Xu.\"	http://www.opengroup.org/unix/online.html.
349653e55fSDavid Xu.\"
359653e55fSDavid Xu.\" $FreeBSD$
369653e55fSDavid Xu.\"
379653e55fSDavid Xu.Dd August 21, 2012
389653e55fSDavid Xu.Dt PTHREAD_GETCPUCLOCKID 3
399653e55fSDavid Xu.Os
409653e55fSDavid Xu.Sh NAME
419653e55fSDavid Xu.Nm pthread_getcpuclockid
429653e55fSDavid Xu.Nd access a thread CPU-time clock
439653e55fSDavid Xu.Sh LIBRARY
449653e55fSDavid Xu.Lb libpthread
459653e55fSDavid Xu.Sh SYNOPSIS
469653e55fSDavid Xu.In pthread.h
479653e55fSDavid Xu.In time.h
489653e55fSDavid Xu.Ft int
499653e55fSDavid Xu.Fn pthread_getcpuclockid "pthread_t thread_id" "clockid_t *clock_id"
509653e55fSDavid Xu.Sh DESCRIPTION
519653e55fSDavid XuThe
529653e55fSDavid Xu.Fn pthread_getcpuclockid
539653e55fSDavid Xureturns the clock ID of the CPU-time clock of the thread specified by
549653e55fSDavid Xu.Fa thread_id .
559653e55fSDavid XuIf the thread described by
569653e55fSDavid Xu.Fa thread_id
579653e55fSDavid Xuexists.
589653e55fSDavid Xu.Sh RETURN VALUES
599653e55fSDavid XuUpon successful completion,
609653e55fSDavid Xu.Fn pthread_getcpuclockid
619653e55fSDavid Xureturns zero; otherwise, an error number is returned to indicate the
629653e55fSDavid Xuerror.
639653e55fSDavid Xu.Sh ERRORS
64*eb6a4342SSergey KandaurovThe
65*eb6a4342SSergey Kandaurov.Fn pthread_getcpuclockid
66*eb6a4342SSergey Kandaurovfunction will fail if:
679653e55fSDavid Xu.Bl -tag -width Er
689653e55fSDavid Xu.It Bq Er ESRCH
699653e55fSDavid XuThe value specified by
709653e55fSDavid Xu.Fa thread_id
719653e55fSDavid Xudoes not refer to an existing thread.
729653e55fSDavid Xu.El
739653e55fSDavid Xu.Sh SEE ALSO
749653e55fSDavid Xu.Xr clock_gettime 2
759653e55fSDavid Xu.Sh STANDARDS
769653e55fSDavid XuThe
779653e55fSDavid Xu.Fn pthread_getcpuclockid
789653e55fSDavid Xufunction conforms to
799653e55fSDavid Xu.St -p1003.1-2004 .
809653e55fSDavid Xu.Sh HISTORY
819653e55fSDavid XuThe
829653e55fSDavid Xu.Fn pthread_getcpuclockid
839653e55fSDavid Xufunction first appeared in
849653e55fSDavid Xu.Fx 10.0 .
859653e55fSDavid Xu.Sh AUTHORS
86a63d6c94SBaptiste Daroussin.An David Xu Aq Mt davidxu@FreeBSD.org
87