xref: /openbsd-src/lib/libc/hidden/sys/timetc.h (revision d82e6535c6efd8305182f77041b2246ccfae1196)
1*d82e6535Spirofti /*	$OpenBSD: timetc.h,v 1.1 2020/07/06 13:33:06 pirofti Exp $	*/
2*d82e6535Spirofti /*
3*d82e6535Spirofti  * Copyright (c) 2020 Paul Irofti <paul@irofti.net>
4*d82e6535Spirofti  *
5*d82e6535Spirofti  * Permission to use, copy, modify, and distribute this software for any
6*d82e6535Spirofti  * purpose with or without fee is hereby granted, provided that the above
7*d82e6535Spirofti  * copyright notice and this permission notice appear in all copies.
8*d82e6535Spirofti  *
9*d82e6535Spirofti  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10*d82e6535Spirofti  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*d82e6535Spirofti  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12*d82e6535Spirofti  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*d82e6535Spirofti  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*d82e6535Spirofti  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15*d82e6535Spirofti  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*d82e6535Spirofti  */
17*d82e6535Spirofti 
18*d82e6535Spirofti #ifndef _LIBC_SYS_TIMETC_H_
19*d82e6535Spirofti #define _LIBC_SYS_TIMETC_H_
20*d82e6535Spirofti 
21*d82e6535Spirofti #define _LIBC
22*d82e6535Spirofti #include <sys/types.h>
23*d82e6535Spirofti #include <sys/time.h>
24*d82e6535Spirofti 
25*d82e6535Spirofti #include_next <sys/timetc.h>
26*d82e6535Spirofti 
27*d82e6535Spirofti __BEGIN_HIDDEN_DECLS
28*d82e6535Spirofti extern struct timekeep *_timekeep;
29*d82e6535Spirofti 
30*d82e6535Spirofti extern int (*const _tc_get_timecount)(struct timekeep *, u_int *);
31*d82e6535Spirofti 
32*d82e6535Spirofti int _microtime(struct timeval *, struct timekeep *);
33*d82e6535Spirofti int _nanotime(struct timespec *, struct timekeep *);
34*d82e6535Spirofti int _nanoruntime(struct timespec *, struct timekeep *);
35*d82e6535Spirofti int _nanouptime(struct timespec *, struct timekeep *);
36*d82e6535Spirofti __END_HIDDEN_DECLS
37*d82e6535Spirofti 
38*d82e6535Spirofti #endif /* !_LIBC_SYS_TIMETC_H_ */
39