This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
gettimeofday and POSIX
- From: Eric Blake <ebb9 at byu dot net>
- To: newlib at sources dot redhat dot com
- Date: Thu, 05 Jul 2007 08:35:23 -0600
- Subject: gettimeofday and POSIX
gnulib projects that use gettimeofday currently crash when configured with
-Werror [1], because gettimeofday has the wrong signature according to
POSIX rules. OK to apply this patch?
[1] http://lists.gnu.org/archive/html/bug-gnulib/2007-07/msg00063.html
2007-07-05 Eric Blake <ebb9@byu.net>
* libc/include/sys/time.h (gettimeofday): Make signature match
POSIX.
Index: libc/include/sys/time.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/time.h,v
retrieving revision 1.10
diff -u -p -b -r1.10 time.h
--- libc/include/sys/time.h 15 Feb 2006 10:26:30 -0000 1.10
+++ libc/include/sys/time.h 5 Jul 2007 14:31:08 -0000
@@ -70,7 +70,11 @@ struct itimerval {
} while (0)
#endif /* defined (__rtems__) || defined (__CYGWIN__) */
+#ifdef _COMPILING_NEWLIB
int _EXFUN(gettimeofday, (struct timeval *__p, struct timezone *__z));
+#else
+int _EXFUN(gettimeofday, (struct timeval *__p, void *__z));
+#endif
int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *));
int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp));
int _EXFUN(getitimer, (int __which, struct itimerval *__value));
--
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net