OSDN Git Service
(root)
/
android-x86
/
bionic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b314090
)
Add timespec/timeval conversion helpers.
author
Bertrand SIMONNET
<bsimonnet@google.com>
Thu, 16 Jul 2015 18:50:39 +0000
(11:50 -0700)
committer
Bertrand SIMONNET
<bsimonnet@google.com>
Thu, 16 Jul 2015 20:10:50 +0000
(13:10 -0700)
TIMESPEC_TO_TIMEVAL and TIMEVAL_TO_TIMESPEC are usually provided by
sys/time.h.
BUG:
22532790
Change-Id: I8b9d7298e3250323faa20b1adf9a7514954c6096
libc/include/sys/time.h
patch
|
blob
|
history
diff --git
a/libc/include/sys/time.h
b/libc/include/sys/time.h
index
1f010d4
..
67107c6
100644
(file)
--- a/
libc/include/sys/time.h
+++ b/
libc/include/sys/time.h
@@
-73,6
+73,15
@@
extern int utimes(const char *, const struct timeval *);
} \
} while (0)
+#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+ (ts)->tv_sec = (tv)->tv_sec; \
+ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
+}
+#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+}
+
__END_DECLS
#endif /* _SYS_TIME_H_ */