diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/x86/gettimeofday.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/x86/gettimeofday.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/x86/gettimeofday.c b/sysdeps/unix/sysv/linux/x86/gettimeofday.c index 8886ccd707..58a8763ef9 100644 --- a/sysdeps/unix/sysv/linux/x86/gettimeofday.c +++ b/sysdeps/unix/sysv/linux/x86/gettimeofday.c @@ -26,7 +26,9 @@ static int __gettimeofday_syscall (struct timeval *tv, struct timezone *tz) { - return INLINE_SYSCALL (gettimeofday, 2, tv, tz); + if (tz) + memset (tz, 0, sizeof (struct timezone)); + return INLINE_SYSCALL (gettimeofday, 2, tv, (void *)0); } # ifndef __gettimeofday_type @@ -52,7 +54,9 @@ libc_hidden_def (__gettimeofday) int __gettimeofday (struct timeval *tv, struct timezone *tz) { - return INLINE_SYSCALL (gettimeofday, 2, tv, tz); + if (tz) + memset (tz, 0, sizeof (struct timezone)); + return INLINE_SYSCALL (gettimeofday, 2, tv, (void *)0); } libc_hidden_def (__gettimeofday) |