|
@@ -9,5 +9,28 @@
|
|
#include <sys/syscall.h>
|
|
#include <sys/syscall.h>
|
|
#include <sys/time.h>
|
|
#include <sys/time.h>
|
|
|
|
|
|
-_syscall2(int, gettimeofday, struct timeval *, tv, __timezone_ptr_t, tz)
|
|
+#include "ldso.h"
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+#ifdef __VDSO_SUPPORT__
|
|
|
|
+typedef int (*gettimeofday_func)(struct timeval * tv, __timezone_ptr_t tz);
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+int gettimeofday(struct timeval * tv, __timezone_ptr_t tz) {
|
|
|
|
+
|
|
|
|
+ #ifdef __VDSO_SUPPORT__
|
|
|
|
+ if ( _dl__vdso_gettimeofday != 0 ){
|
|
|
|
+ gettimeofday_func func= _dl__vdso_gettimeofday;
|
|
|
|
+ return func( tv, tz );
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ _syscall2_body(int, gettimeofday, struct timeval *, tv, __timezone_ptr_t, tz)
|
|
|
|
+ }
|
|
|
|
+ #else
|
|
|
|
+ _syscall2_body(int, gettimeofday, struct timeval *, tv, __timezone_ptr_t, tz)
|
|
|
|
+ #endif
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
libc_hidden_def(gettimeofday)
|
|
libc_hidden_def(gettimeofday)
|