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