Check for getrusage
authorRamiro Polla <ramiro.polla@gmail.com>
Fri, 13 Jul 2007 16:04:00 +0000 (16:04 +0000)
committerRamiro Polla <ramiro.polla@gmail.com>
Fri, 13 Jul 2007 16:04:00 +0000 (16:04 +0000)
Originally committed as revision 9627 to svn://svn.ffmpeg.org/ffmpeg/trunk

configure
ffmpeg.c

index e5bac72..cf52539 100755 (executable)
--- a/configure
+++ b/configure
@@ -667,6 +667,7 @@ HAVE_LIST="
     fast_unaligned
     fork
     freetype2
+    getrusage
     imlib2
     inet_aton
     lrintf
@@ -1596,6 +1597,8 @@ elif check_func dlopen -ldl; then
     ldl=-ldl
 fi
 
+check_func getrusage
+
 check_func fork
 
 test "$vhook" = "default" && vhook="$dlopen"
index d5cc28a..795ca4c 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3113,10 +3113,12 @@ static int64_t getutime(void)
 #else
 static int64_t getutime(void)
 {
+#ifdef HAVE_GETRUSAGE
     struct rusage rusage;
 
     getrusage(RUSAGE_SELF, &rusage);
     return (rusage.ru_utime.tv_sec * 1000000LL) + rusage.ru_utime.tv_usec;
+#endif
 }
 #endif