gettimeofday: fix static build
[uclibc-ng.git] / libc / sysdeps / linux / common / gettimeofday.c
blob12473a8e62b6d1fdfd40d9ce4bfdba2110866637
1 /*
2 * gettimeofday() for uClibc
4 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
6 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 */
9 #include <sys/syscall.h>
10 #include <sys/time.h>
12 #ifdef SHARED
13 #include "ldso.h"
14 #endif
17 #ifdef __VDSO_SUPPORT__
18 typedef int (*gettimeofday_func)(struct timeval * tv, __timezone_ptr_t tz);
19 #endif
21 int gettimeofday(struct timeval * tv, __timezone_ptr_t tz) {
23 #ifdef __VDSO_SUPPORT__
24 if ( _dl__vdso_gettimeofday != 0 ){
25 gettimeofday_func func= _dl__vdso_gettimeofday;
26 return func( tv, tz );
28 }else{
29 _syscall2_body(int, gettimeofday, struct timeval *, tv, __timezone_ptr_t, tz)
31 #else
32 _syscall2_body(int, gettimeofday, struct timeval *, tv, __timezone_ptr_t, tz)
33 #endif
37 libc_hidden_def(gettimeofday)