File time-debian-rusage-portability.patch of Package time
Subject: struct rusage and sys/resource.h portability fix
Author: Dirk Eddelbuettel
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=144819
--- time-1.7.orig/resuse.h
+++ time-1.7/resuse.h
@@ -38,22 +38,11 @@
#else
# define TV_MSEC tv_usec / 1000
# define TV_USEC tv_usec
-# if HAVE_WAIT3
+# if HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
# else
# if defined(__linux__) && defined(__alpha__)
# include <sys/resource.h>
-# else
-/* Process resource usage structure. */
-struct rusage
-{
- struct timeval ru_utime; /* User time used. */
- struct timeval ru_stime; /* System time used. */
- int ru_maxrss, ru_ixrss, ru_idrss, ru_isrss,
- ru_minflt, ru_majflt, ru_nswap, ru_inblock,
- ru_oublock, ru_msgsnd, ru_msgrcv, ru_nsignals,
- ru_nvcsw, ru_nivcsw;
-};
# endif
# endif
#endif
--- time-1.7.orig/configure.in
+++ time-1.7/configure.in
@@ -15,7 +15,7 @@
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h)
+AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h sys/resource.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST