summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-09-30 13:58:29 -0400
committerTavian Barnes <tavianator@gmail.com>2011-09-30 13:58:29 -0400
commitb14a87691f42be83691861b97a2f410c25c9c4bb (patch)
treefd509aaf5cb8d0d99041032432ba981bbe939a09 /configure.ac
parent58f76df83f01ae4cad3781ea5366b5a782cb1e29 (diff)
downloaddimension-b14a87691f42be83691861b97a2f410c25c9c4bb.tar.xz
Add a getrusage() implementation of dmnsn_get_times().
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 06e9b0a..d763041 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,27 @@ AC_COMPILE_IFELSE([
AC_MSG_RESULT([no])]
)
+AC_MSG_CHECKING([for getrusage()])
+AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [
+ #include <stddef.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ ],
+ [
+ struct timeval real;
+ gettimeofday(&real, NULL);
+ struct rusage usage;
+ getrusage(RUSAGE_SELF, &usage);
+ ]
+ )],
+ [AC_DEFINE([DMNSN_GETRUSAGE], [1])
+ AC_MSG_RESULT([yes])],
+ [AC_DEFINE([DMNSN_GETRUSAGE], [0])
+ AC_MSG_RESULT([no])]
+)
+
AC_MSG_CHECKING([for times()])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(