xref: /freebsd/share/man/man3/pthread_getcpuclockid.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
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.Dd August 21, 2012
369653e55fSDavid Xu.Dt PTHREAD_GETCPUCLOCKID 3
379653e55fSDavid Xu.Os
389653e55fSDavid Xu.Sh NAME
399653e55fSDavid Xu.Nm pthread_getcpuclockid
409653e55fSDavid Xu.Nd access a thread CPU-time clock
419653e55fSDavid Xu.Sh LIBRARY
429653e55fSDavid Xu.Lb libpthread
439653e55fSDavid Xu.Sh SYNOPSIS
449653e55fSDavid Xu.In pthread.h
459653e55fSDavid Xu.In time.h
469653e55fSDavid Xu.Ft int
479653e55fSDavid Xu.Fn pthread_getcpuclockid "pthread_t thread_id" "clockid_t *clock_id"
489653e55fSDavid Xu.Sh DESCRIPTION
499653e55fSDavid XuThe
509653e55fSDavid Xu.Fn pthread_getcpuclockid
519653e55fSDavid Xureturns the clock ID of the CPU-time clock of the thread specified by
52*18ac59f4SSergey Kandaurov.Fa thread_id ,
53*18ac59f4SSergey Kandaurovif the thread described by
549653e55fSDavid Xu.Fa thread_id
559653e55fSDavid Xuexists.
569653e55fSDavid Xu.Sh RETURN VALUES
579653e55fSDavid XuUpon successful completion,
589653e55fSDavid Xu.Fn pthread_getcpuclockid
599653e55fSDavid Xureturns zero; otherwise, an error number is returned to indicate the
609653e55fSDavid Xuerror.
619653e55fSDavid Xu.Sh ERRORS
62eb6a4342SSergey KandaurovThe
63eb6a4342SSergey Kandaurov.Fn pthread_getcpuclockid
64eb6a4342SSergey Kandaurovfunction will fail if:
659653e55fSDavid Xu.Bl -tag -width Er
669653e55fSDavid Xu.It Bq Er ESRCH
679653e55fSDavid XuThe value specified by
689653e55fSDavid Xu.Fa thread_id
699653e55fSDavid Xudoes not refer to an existing thread.
709653e55fSDavid Xu.El
719653e55fSDavid Xu.Sh SEE ALSO
729653e55fSDavid Xu.Xr clock_gettime 2
739653e55fSDavid Xu.Sh STANDARDS
749653e55fSDavid XuThe
759653e55fSDavid Xu.Fn pthread_getcpuclockid
769653e55fSDavid Xufunction conforms to
779653e55fSDavid Xu.St -p1003.1-2004 .
789653e55fSDavid Xu.Sh HISTORY
799653e55fSDavid XuThe
809653e55fSDavid Xu.Fn pthread_getcpuclockid
819653e55fSDavid Xufunction first appeared in
829653e55fSDavid Xu.Fx 10.0 .
839653e55fSDavid Xu.Sh AUTHORS
84a63d6c94SBaptiste Daroussin.An David Xu Aq Mt davidxu@FreeBSD.org
85