]>
git.proxmox.com Git - mirror_spl.git/blob - include/sys/time.h
2 * This file is part of the SPL: Solaris Porting Layer.
4 * Copyright (c) 2008 Lawrence Livermore National Security, LLC.
5 * Produced at Lawrence Livermore National Laboratory
7 * Brian Behlendorf <behlendorf1@llnl.gov>,
8 * Herb Wartens <wartens2@llnl.gov>,
9 * Jim Garlick <garlick@llnl.gov>
12 * This is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 * Structure returned by gettimeofday(2) system call,
32 * and used in other calls.
39 #include <linux/module.h>
40 #include <linux/time.h>
41 #include <sys/types.h>
43 #define TIME32_MAX INT32_MAX
44 #define TIME32_MIN INT32_MIN
48 #define MICROSEC 1000000
49 #define NANOSEC 1000000000
51 /* Already defined in include/linux/time.h */
52 #undef CLOCK_THREAD_CPUTIME_ID
54 #undef CLOCK_MONOTONIC
55 #undef CLOCK_PROCESS_CPUTIME_ID
57 typedef enum clock_type
{
58 __CLOCK_REALTIME0
= 0, /* obsolete; same as CLOCK_REALTIME */
59 CLOCK_VIRTUAL
= 1, /* thread's user-level CPU clock */
60 CLOCK_THREAD_CPUTIME_ID
= 2, /* thread's user+system CPU clock */
61 CLOCK_REALTIME
= 3, /* wall clock */
62 CLOCK_MONOTONIC
= 4, /* high resolution monotonic clock */
63 CLOCK_PROCESS_CPUTIME_ID
= 5, /* process's user+system CPU clock */
64 CLOCK_HIGHRES
= CLOCK_MONOTONIC
, /* alternate name */
65 CLOCK_PROF
= CLOCK_THREAD_CPUTIME_ID
,/* alternate name */
70 ASSERT(HZ >= 100 && HZ <= MICROSEC); \
74 extern void __gethrestime(timestruc_t
*);
75 extern int __clock_gettime(clock_type_t
, timespec_t
*);
76 extern hrtime_t
__gethrtime(void);
78 #define gethrestime(ts) __gethrestime(ts)
79 #define clock_gettime(fl, tp) __clock_gettime(fl, tp)
80 #define gethrtime() __gethrtime()
82 static __inline__
time_t
95 #endif /* _SPL_TIME_H */