projects
/
proxmark3-svn
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change product desc to 9 and add extra null byte
[proxmark3-svn]
/
client
/
util_posix.c
diff --git
a/client/util_posix.c
b/client/util_posix.c
index 382f6a60799cb1483c23b90181b3d2a28c147c7f..32158adab3403fa394f1406d40961692ad19425d 100644
(file)
--- a/
client/util_posix.c
+++ b/
client/util_posix.c
@@
-31,14
+31,18
@@
static void nsleep(uint64_t n) {
}
void msleep(uint32_t n) {
}
void msleep(uint32_t n) {
- nsleep(1000000 * n);
+ nsleep(1000000 *
(uint64_t)
n);
}
#endif // _WIN32
}
#endif // _WIN32
-#ifdef __
MACH
__
+#ifdef __
APPLE
__
+#ifndef CLOCK_MONOTONIC
#define CLOCK_MONOTONIC (1)
#define CLOCK_MONOTONIC (1)
+#endif
+#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME (2)
#define CLOCK_REALTIME (2)
+#endif
#include <sys/time.h>
#include <mach/clock.h>
#include <sys/time.h>
#include <mach/clock.h>
@@
-63,20
+67,18
@@
void msleep(uint32_t n) {
} else if (clk_id == CLOCK_MONOTONIC) {
static uint64_t clock_start_time = 0;
} else if (clk_id == CLOCK_MONOTONIC) {
static uint64_t clock_start_time = 0;
- static mach_timebase_info_data_t timebase_ifo = {0, 0};
+ static mach_timebase_info_data_t timebase_i
n
fo = {0, 0};
uint64_t now = mach_absolute_time();
if (clock_start_time == 0) {
uint64_t now = mach_absolute_time();
if (clock_start_time == 0) {
- //kern_return_t mach_status = mach_timebase_info(&timebase_ifo);
- // appease "unused variable" warning for release builds
- //(void)mach_status;
+ mach_timebase_info(&timebase_info);
clock_start_time = now;
}
now = (uint64_t)((double)(now - clock_start_time)
clock_start_time = now;
}
now = (uint64_t)((double)(now - clock_start_time)
- * (double)timebase_ifo.numer
- / (double)timebase_ifo.denom);
+ * (double)timebase_i
n
fo.numer
+ / (double)timebase_i
n
fo.denom);
t->tv_sec = now / 1000000000;
t->tv_nsec = now % 1000000000;
t->tv_sec = now / 1000000000;
t->tv_nsec = now % 1000000000;
Impressum
,
Datenschutz