1331722Seadler/*
2239347Sdavidxu * Copyright (c) 2012 David Xu <davidxu@FreeBSD.org>.
3239347Sdavidxu * All rights reserved.
4239347Sdavidxu *
5239347Sdavidxu * Redistribution and use in source and binary forms, with or without
6239347Sdavidxu * modification, are permitted provided that the following conditions
7239347Sdavidxu * are met:
8239347Sdavidxu * 1. Redistributions of source code must retain the above copyright
9239347Sdavidxu *    notice, this list of conditions and the following disclaimer.
10239347Sdavidxu * 2. Redistributions in binary form must reproduce the above copyright
11239347Sdavidxu *    notice, this list of conditions and the following disclaimer in the
12239347Sdavidxu *    documentation and/or other materials provided with the distribution.
13239347Sdavidxu *
14239347Sdavidxu * THIS SOFTWARE IS PROVIDED BY DANIEL EISCHEN AND CONTRIBUTORS ``AS IS''
15239347Sdavidxu * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16239347Sdavidxu * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17239347Sdavidxu * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18239347Sdavidxu * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19239347Sdavidxu * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20239347Sdavidxu * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21239347Sdavidxu * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22239347Sdavidxu * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23239347Sdavidxu * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24239347Sdavidxu * SUCH DAMAGE.
25239347Sdavidxu */
26239347Sdavidxu
27239347Sdavidxu#include <sys/cdefs.h>
28239347Sdavidxu__FBSDID("$FreeBSD$");
29239347Sdavidxu
30239347Sdavidxu#include <errno.h>
31239347Sdavidxu#include <time.h>
32239347Sdavidxu#include <unistd.h>
33239347Sdavidxu#include <sys/time.h>
34239347Sdavidxu
35239485Sdavidxuint
36239347Sdavidxuclock_getcpuclockid(pid_t pid, clockid_t *clock_id)
37239347Sdavidxu{
38239485Sdavidxu	if (clock_getcpuclockid2(pid, CPUCLOCK_WHICH_PID, clock_id))
39239485Sdavidxu		return (errno);
40239485Sdavidxu	return (0);
41239347Sdavidxu}
42