-/* $OpenBSD: time.h,v 1.31 2018/10/30 16:28:42 guenther Exp $ */
+/* $OpenBSD: time.h,v 1.32 2022/10/25 16:30:30 millert Exp $ */
/* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */
/*
#include <sys/cdefs.h>
#include <sys/_null.h>
#include <sys/_types.h>
+#include <sys/_time.h>
#ifndef _CLOCK_T_DEFINED_
#define _CLOCK_T_DEFINED_
#define CLK_TCK 100
#endif
-#define CLOCKS_PER_SEC 100 /* frequency of ticks reported by clock(). */
-
-#if __POSIX_VISIBLE >= 199309 || __ISO_C_VISIBLE >= 2011
-#ifndef _TIMESPEC_DECLARED
-#define _TIMESPEC_DECLARED
-struct timespec {
- time_t tv_sec; /* seconds */
- long tv_nsec; /* and nanoseconds */
-};
-#endif
-#endif
-
#if __POSIX_VISIBLE >= 199309
-#include <sys/_time.h>
-
#ifndef _CLOCKID_T_DEFINED_
#define _CLOCKID_T_DEFINED_
typedef __clockid_t clockid_t;
-/* $OpenBSD: _time.h,v 1.9 2017/12/18 05:51:53 cheloha Exp $ */
+/* $OpenBSD: _time.h,v 1.10 2022/10/25 16:30:30 millert Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
#ifndef _SYS__TIME_H_
#define _SYS__TIME_H_
-#define CLOCK_REALTIME 0
-#define CLOCK_PROCESS_CPUTIME_ID 2
-#define CLOCK_MONOTONIC 3
-#define CLOCK_THREAD_CPUTIME_ID 4
-#define CLOCK_UPTIME 5
-#define CLOCK_BOOTTIME 6
+/* Frequency of ticks reported by clock(). */
+#define CLOCKS_PER_SEC 100
#if __BSD_VISIBLE
/*
#define __CLOCK_PTID(c) (((c) >> 12) & 0xfffff)
#endif
+#if __POSIX_VISIBLE >= 199309 || __ISO_C_VISIBLE >= 2011
+#ifndef _TIME_T_DEFINED_
+#define _TIME_T_DEFINED_
+typedef __time_t time_t;
+#endif
+
+#ifndef _TIMESPEC_DECLARED
+#define _TIMESPEC_DECLARED
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* and nanoseconds */
+};
+#endif
+#endif
+
+#if __POSIX_VISIBLE >= 199309
+#define CLOCK_REALTIME 0
+#define CLOCK_PROCESS_CPUTIME_ID 2
+#define CLOCK_MONOTONIC 3
+#define CLOCK_THREAD_CPUTIME_ID 4
+#define CLOCK_UPTIME 5
+#define CLOCK_BOOTTIME 6
+
/*
* Structure defined by POSIX 1003.1b to be like a itimerval,
* but with timespecs. Used in the timer_*() system calls.
#define TIMER_RELTIME 0x0 /* relative timer */
#define TIMER_ABSTIME 0x1 /* absolute timer */
+#endif
+
#endif /* !_SYS__TIME_H_ */