]> granicus.if.org Git - php/commitdiff
(PHP getrusage) don't define this function at all if the getrusage() function
authorStig Bakken <ssb@php.net>
Wed, 23 Feb 2000 21:37:43 +0000 (21:37 +0000)
committerStig Bakken <ssb@php.net>
Wed, 23 Feb 2000 21:37:43 +0000 (21:37 +0000)
is not available on the system.

ext/standard/basic_functions.c
ext/standard/microtime.c

index 869067f5a7eb960092cdc0277f73b5045016f971..9b97d609f876376b6b62a141a88c63b3e394bf1b 100644 (file)
@@ -242,7 +242,9 @@ function_entry basic_functions[] = {
 
        PHP_FE(microtime,                                                               NULL)
        PHP_FE(gettimeofday,                                                    NULL)
+#ifdef HAVE_GETRUSAGE
        PHP_FE(getrusage,                                                               NULL)
+#endif
        
        PHP_FE(uniqid,                                                                  NULL)
                
index 360a0780dfc1a1d333cd19bc4d74de6432883d3b..205c832d033c2fa1933ed0f8e6473fcfbd7e1ed5 100644 (file)
@@ -90,11 +90,11 @@ PHP_FUNCTION(gettimeofday)
 }
 /* }}} */
 
+#ifdef HAVE_GETRUSAGE
 /* {{{ proto array getrusage([ int who ])
    returns an array of usage statistics */
 PHP_FUNCTION(getrusage)
 {
-#if HAVE_GETRUSAGE
        struct rusage usg;
        int ac = ARG_COUNT(ht);
        pval **pwho;
@@ -134,8 +134,9 @@ PHP_FUNCTION(getrusage)
        PHP3_RUSAGE_PARA(ru_stime.tv_usec);
        PHP3_RUSAGE_PARA(ru_stime.tv_sec);
 #undef PHP3_RUSAGE_PARA
-#endif /* HAVE_GETRUSAGE */
 }
+#endif /* HAVE_GETRUSAGE */
+
 /* }}} */