mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Remap gethrestime() with #define to new symbol and export that new
symbol to avoid direct use of GPL only symbol. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@36 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
+17
-16
@@ -15,14 +15,17 @@ extern "C" {
|
||||
#include <sys/types.h>
|
||||
|
||||
extern unsigned long long monotonic_clock(void);
|
||||
extern void __gethrestime(timestruc_t *);
|
||||
|
||||
#define TIME32_MAX INT32_MAX
|
||||
#define TIME32_MIN INT32_MIN
|
||||
#define gethrestime(ts) __gethrestime(ts)
|
||||
|
||||
#define SEC 1
|
||||
#define MILLISEC 1000
|
||||
#define MICROSEC 1000000
|
||||
#define NANOSEC 1000000000
|
||||
#define TIME32_MAX INT32_MAX
|
||||
#define TIME32_MIN INT32_MIN
|
||||
|
||||
#define SEC 1
|
||||
#define MILLISEC 1000
|
||||
#define MICROSEC 1000000
|
||||
#define NANOSEC 1000000000
|
||||
|
||||
#define hz \
|
||||
({ \
|
||||
@@ -30,7 +33,14 @@ extern unsigned long long monotonic_clock(void);
|
||||
HZ; \
|
||||
})
|
||||
|
||||
#define gethrestime(ts) getnstimeofday((ts))
|
||||
static __inline__ time_t
|
||||
gethrestime_sec(void)
|
||||
{
|
||||
timestruc_t now;
|
||||
|
||||
__gethrestime(&now);
|
||||
return now.tv_sec;
|
||||
}
|
||||
|
||||
static __inline__ hrtime_t
|
||||
gethrtime(void) {
|
||||
@@ -44,15 +54,6 @@ gethrtime(void) {
|
||||
return monotonic_clock();
|
||||
}
|
||||
|
||||
static __inline__ time_t
|
||||
gethrestime_sec(void)
|
||||
{
|
||||
timestruc_t now;
|
||||
|
||||
gethrestime(&now);
|
||||
return (now.tv_sec);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user