]> granicus.if.org Git - apache/commitdiff
Deal with times() properly in autoconf. This also changes NO_TIMES to
authorManoj Kasichainula <manoj@apache.org>
Tue, 30 Nov 1999 03:52:57 +0000 (03:52 +0000)
committerManoj Kasichainula <manoj@apache.org>
Tue, 30 Nov 1999 03:52:57 +0000 (03:52 +0000)
!HAVE_TIMES.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84193 13f79535-47bb-0310-9956-ffa450edef68

13 files changed:
configure.in
include/ap_config.h
modules/aaa/config.m4
modules/metadata/mod_usertrack.c
os/win32/os.h
server/mpm/mpmt_pthread/config.m4
server/mpm/mpmt_pthread/scoreboard.c
server/mpm/mpmt_pthread/scoreboard.h
server/mpm/prefork/config.m4
server/mpm/prefork/prefork.c
server/mpm/prefork/scoreboard.h
server/mpm/spmt_os2/scoreboard.h
server/mpm/spmt_os2/spmt_os2.c

index 8d5a58f8e9d29baa6fcb2d0621b612341c7593a0..c6d9fda73ff8d81d7ac51dcb8929fd76d5ac538d 100644 (file)
@@ -45,7 +45,6 @@ dnl directory, they should be moved (Comment #Spoon)
 
 AC_CHECK_HEADERS( \
 unistd.h \
-sys/times.h \
 sys/time.h \
 )
 
index 82fc5dd67bbb2eb2d6d290b4327202fc87a7ccd0..d4cf01e80a359c90ed1c655b028995635aa26be7 100644 (file)
@@ -1401,6 +1401,11 @@ long vfprintf(FILE *, const char *, va_list);
 #define HAVE_SETSID
 #endif
 
+#if !defined(NO_TIMES) && !defined(HAVE_TIMES)
+#define HAVE_TIMES
+#define HAVE_SYS_TIMES_H
+#endif
+
 #endif /* HAVE_CONFIG_H */
 
 /* The assumption is that when the functions are missing,
index 9d069b51c769ce61183c6d5fd60fe72e417275ea..afbeed66bd42eb8c4dce4c69db272cdeffad1002 100644 (file)
@@ -1 +1,6 @@
+
+dnl ## mod_usertrack.c
+AC_CHECK_HEADERS(sys/times.h)
+AC_CHECK_FUNCS(times)
+
 APACHE_MODULE(standard)
index 6e46bb89e102d78e3dd8da06853ed2f5e5bee0af..4ded3a0aeea9ad12a00913205eed9acd78e16ee2 100644 (file)
 #if !defined(WIN32) && !defined(MPE)
 #include <sys/time.h>
 #endif
+#ifdef HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
 
 module MODULE_VAR_EXPORT usertrack_module;
 
@@ -132,7 +135,7 @@ static void make_cookie(request_rec *r)
 {
     cookie_log_state *cls = ap_get_module_config(r->server->module_config,
                                                 &usertrack_module);
-#if !defined(HAVE_GETTIMEOFDAY) && !defined(NO_TIMES)
+#if !defined(HAVE_GETTIMEOFDAY) && defined(HAVE_TIMES)
     clock_t mpe_times;
     struct tms mpe_tms;
 #elif !defined(WIN32)
@@ -148,7 +151,7 @@ static void make_cookie(request_rec *r)
 
     dcfg = ap_get_module_config(r->per_dir_config, &usertrack_module);
 
-#if !defined(HAVE_GETTIMEOFDAY) && !defined(NO_TIMES)
+#if !defined(HAVE_GETTIMEOFDAY) && defined(HAVE_TIMES)
 /* We lack gettimeofday(), so we must use time() to obtain the epoch
    seconds, and then times() to obtain CPU clock ticks (milliseconds).
    Combine this together to obtain a hopefully unique cookie ID. */
index f0c58312536a5497db94e81c0904e7f689aa8189..ff3f2e0378d8be08d9e7a7377cfdfd6af1771827 100644 (file)
@@ -99,7 +99,7 @@
 #define CASE_BLIND_FILESYSTEM
 #define NO_WRITEV
 #define NO_USE_SIGACTION
-#define NO_TIMES
+/* #undef HAVE_TIMES */
 /* #undef HAVE_GETTIMEOFDAY */
 #define USE_LONGJMP
 #define HAVE_MMAP
index a60c6a58019c1215c1fba5a60b110aa781f9ae5b..00636a151e4bd70f75f36b410fce349074fdb17a 100644 (file)
@@ -2,6 +2,11 @@ dnl ## XXX - Need a more thorough check of the proper flags to use
 
 if test "$MPM_NAME" = "mpmt_pthread" ; then
     APACHE_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
+
     APACHE_MPM_PTHREAD
     APACHE_MPM_CHECK_SHMEM
+
+dnl Obsolete scoreboard code uses this.
+    AC_CHECK_HEADERS(sys/times.h)
+    AC_CHECK_FUNCS(times)
 fi
index 0e82e1838ce9a5b00541ce946fb643589072c19d..e1e5ebc4c40575e697de9153e035fd10d65a1642 100644 (file)
@@ -560,7 +560,7 @@ void increment_counts(int child_num, int thread_num, request_rec *r)
     if (r->sent_bodyct)
        ap_bgetopt(r->connection->client, BO_BYTECT, &bs);
 
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
     times(&ss->times);
 #endif
     ss->access_count++;
index c534350a768ead4d8c39b45c1df0b9983e33e001..dc69f5b64df74db6653559e10a3a4786af5a8900 100644 (file)
 extern "C" {
 #endif
 
-#ifndef WIN32
-#ifdef TPF
-#include <time.h>
-#else
+#ifdef HAVE_SYS_TIMES_H
 #include <sys/times.h>
-#endif /* TPF */
+#elif defined(TPF)
+#include <time.h>
 #endif
 
 #include "mpm_default.h"       /* For HARD_.*_LIMIT */
@@ -154,7 +152,7 @@ typedef struct {
     struct timeval start_time;
     struct timeval stop_time;
 #endif
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
     struct tms times;
 #endif
 #ifndef OPTIMIZE_TIMEOUTS
index b4cfe383576649ea30020a3c3d7aa33fe2270c4b..747b318d4d32df82f3fc7754176b0463ddd7fd1b 100644 (file)
@@ -2,4 +2,8 @@ if test "$MPM_NAME" = "prefork" ; then
     APACHE_OUTPUT(modules/mpm/$MPM_NAME/Makefile)
 
     APACHE_MPM_CHECK_SHMEM
+
+dnl Obsolete scoreboard code uses this.
+    AC_CHECK_HEADERS(sys/times.h)
+    AC_CHECK_FUNCS(times)
 fi
index 3f0f87d96377b314c3edf33771998dbafa2a6942..39e1efe5be9acc356a0162e7bcc21d51f70379f2 100644 (file)
@@ -1474,7 +1474,7 @@ static void update_scoreboard_global(void)
 void ap_time_process_request(int child_num, int status)
 {
     short_score *ss;
-#if !defined(HAVE_GETTIMEOFDAY) && !defined(NO_TIMES)
+#if !defined(HAVE_GETTIMEOFDAY) && defined(HAVE_TIMES)
     struct tms tms_blk;
 #endif
 
@@ -1486,9 +1486,9 @@ void ap_time_process_request(int child_num, int status)
 
     if (status == START_PREQUEST) {
 #if !defined(HAVE_GETTIMEOFDAY)
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
        if ((ss->start_time = times(&tms_blk)) == -1)
-#endif /* NO_TIMES */
+#endif /* HAVE_TIMES */
            ss->start_time = (clock_t) 0;
 #else
        if (gettimeofday(&ss->start_time, (struct timezone *) 0) < 0)
@@ -1498,7 +1498,7 @@ void ap_time_process_request(int child_num, int status)
     }
     else if (status == STOP_PREQUEST) {
 #if !defined(HAVE_GETTIMEOFDAY)
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
        if ((ss->stop_time = times(&tms_blk)) == -1)
 #endif
            ss->stop_time = ss->start_time = (clock_t) 0;
@@ -1527,7 +1527,7 @@ static void increment_counts(int child_num, request_rec *r)
     if (r->sent_bodyct)
        ap_bgetopt(r->connection->client, BO_BYTECT, &bs);
 
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
     times(&ss->times);
 #endif
     ss->access_count++;
index 9c60a7f50dd21913ff5d1582535cf2daa4d4fe25..a2d9f3accff5f048f95656942119e61d796e07a2 100644 (file)
@@ -70,6 +70,10 @@ extern "C" {
 #endif /* TPF */
 #endif
 
+#ifdef HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
+
 /* Scoreboard info on a process is, for now, kept very brief --- 
  * just status value and pid (the latter so that the caretaker process
  * can properly update the scoreboard when a process dies).  We may want
@@ -149,7 +153,7 @@ typedef struct {
     struct timeval start_time;
     struct timeval stop_time;
 #endif
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
     struct tms times;
 #endif
 #ifndef OPTIMIZE_TIMEOUTS
index 762c2ffc8b188b3c161e75b0b90cac6dd6ef6124..a34576682479f27b484fa86ae24487564d126a60 100644 (file)
@@ -62,7 +62,9 @@
 extern "C" {
 #endif
 
+#ifdef HAVE_SYS_TIMES_H
 #include <sys/times.h>
+#endif
 
 /* Scoreboard info on a thread is, for now, kept very brief --- 
  * just status value and pid (the latter so that the caretaker thread
@@ -143,7 +145,7 @@ typedef struct {
     struct timeval start_time;
     struct timeval stop_time;
 #endif
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
     struct tms times;
 #endif
 #ifndef OPTIMIZE_TIMEOUTS
index 109dbb8ab6c2309afdd942ddea9c89f97451bf31..09d305b386bd5a45c7c45b4aaacf910b1b62c805 100644 (file)
@@ -429,7 +429,7 @@ int ap_update_child_status(int child_num, int status, request_rec *r)
 void ap_time_process_request(int child_num, int status)
 {
     short_score *ss;
-#if !defined(HAVE_GETTIMEOFDAY) && !defined(NO_TIMES)
+#if !defined(HAVE_GETTIMEOFDAY) && defined(HAVE_TIMES)
     struct tms tms_blk;
 #endif
 
@@ -440,9 +440,9 @@ void ap_time_process_request(int child_num, int status)
 
     if (status == START_PREQUEST) {
 #if !defined(HAVE_GETTIMEOFDAY)
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
        if ((ss->start_time = times(&tms_blk)) == -1)
-#endif /* NO_TIMES */
+#endif /* HAVE_TIMES */
            ss->start_time = (clock_t) 0;
 #else
        if (gettimeofday(&ss->start_time, (struct timezone *) 0) < 0)
@@ -452,7 +452,7 @@ void ap_time_process_request(int child_num, int status)
     }
     else if (status == STOP_PREQUEST) {
 #if !defined(HAVE_GETTIMEOFDAY)
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
        if ((ss->stop_time = times(&tms_blk)) == -1)
 #endif
            ss->stop_time = ss->start_time = (clock_t) 0;
@@ -478,7 +478,7 @@ static void increment_counts(int child_num, request_rec *r)
     if (r->sent_bodyct)
        ap_bgetopt(r->connection->client, BO_BYTECT, &bs);
 
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
     times(&ss->times);
 #endif
     ss->access_count++;