manoj 99/11/29 19:52:58
Modified: src configure.in
src/include ap_config.h
src/modules/mpm/mpmt_pthread config.m4 scoreboard.c
scoreboard.h
src/modules/mpm/prefork config.m4 prefork.c scoreboard.h
src/modules/mpm/spmt_os2 scoreboard.h spmt_os2.c
src/modules/standard config.m4 mod_usertrack.c
src/os/win32 os.h
Log:
Deal with times() properly in autoconf. This also changes NO_TIMES to
!HAVE_TIMES.
Revision Changes Path
1.4 +0 -1 apache-2.0/src/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/apache-2.0/src/configure.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -u -r1.3 -r1.4
--- configure.in 1999/11/30 03:07:32 1.3
+++ configure.in 1999/11/30 03:52:36 1.4
@@ -45,7 +45,6 @@
AC_CHECK_HEADERS( \
unistd.h \
-sys/times.h \
sys/time.h \
)
1.11 +5 -0 apache-2.0/src/include/ap_config.h
Index: ap_config.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/ap_config.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -u -r1.10 -r1.11
--- ap_config.h 1999/11/29 23:32:37 1.10
+++ ap_config.h 1999/11/30 03:52:39 1.11
@@ -1401,6 +1401,11 @@
#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,
1.2 +5 -0 apache-2.0/src/modules/mpm/mpmt_pthread/config.m4
Index: config.m4
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/config.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -u -r1.1 -r1.2
--- config.m4 1999/11/29 23:46:44 1.1
+++ config.m4 1999/11/30 03:52:41 1.2
@@ -2,6 +2,11 @@
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
1.12 +1 -1 apache-2.0/src/modules/mpm/mpmt_pthread/scoreboard.c
Index: scoreboard.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/scoreboard.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -u -r1.11 -r1.12
--- scoreboard.c 1999/11/19 18:46:50 1.11
+++ scoreboard.c 1999/11/30 03:52:42 1.12
@@ -560,7 +560,7 @@
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++;
1.7 +4 -6 apache-2.0/src/modules/mpm/mpmt_pthread/scoreboard.h
Index: scoreboard.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/scoreboard.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -u -r1.6 -r1.7
--- scoreboard.h 1999/11/29 23:32:54 1.6
+++ scoreboard.h 1999/11/30 03:52:43 1.7
@@ -62,12 +62,10 @@
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 @@
struct timeval start_time;
struct timeval stop_time;
#endif
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
struct tms times;
#endif
#ifndef OPTIMIZE_TIMEOUTS
1.2 +4 -0 apache-2.0/src/modules/mpm/prefork/config.m4
Index: config.m4
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/config.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -u -r1.1 -r1.2
--- config.m4 1999/11/29 23:46:50 1.1
+++ config.m4 1999/11/30 03:52:45 1.2
@@ -2,4 +2,8 @@
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
1.56 +5 -5 apache-2.0/src/modules/mpm/prefork/prefork.c
Index: prefork.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -u -r1.55 -r1.56
--- prefork.c 1999/11/29 23:32:56 1.55
+++ prefork.c 1999/11/30 03:52:46 1.56
@@ -1474,7 +1474,7 @@
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 @@
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 @@
}
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 @@
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++;
1.3 +5 -1 apache-2.0/src/modules/mpm/prefork/scoreboard.h
Index: scoreboard.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/scoreboard.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -u -r1.2 -r1.3
--- scoreboard.h 1999/11/29 23:32:58 1.2
+++ scoreboard.h 1999/11/30 03:52:47 1.3
@@ -70,6 +70,10 @@
#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 @@
struct timeval start_time;
struct timeval stop_time;
#endif
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
struct tms times;
#endif
#ifndef OPTIMIZE_TIMEOUTS
1.4 +3 -1 apache-2.0/src/modules/mpm/spmt_os2/scoreboard.h
Index: scoreboard.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/spmt_os2/scoreboard.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -u -r1.3 -r1.4
--- scoreboard.h 1999/11/29 23:33:01 1.3
+++ scoreboard.h 1999/11/30 03:52:51 1.4
@@ -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 @@
struct timeval start_time;
struct timeval stop_time;
#endif
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
struct tms times;
#endif
#ifndef OPTIMIZE_TIMEOUTS
1.26 +5 -5 apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c
Index: spmt_os2.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -u -r1.25 -r1.26
--- spmt_os2.c 1999/11/29 23:33:02 1.25
+++ spmt_os2.c 1999/11/30 03:52:51 1.26
@@ -429,7 +429,7 @@
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 @@
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 @@
}
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 @@
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++;
1.2 +5 -0 apache-2.0/src/modules/standard/config.m4
Index: config.m4
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/config.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -u -r1.1 -r1.2
--- config.m4 1999/11/29 23:47:11 1.1
+++ config.m4 1999/11/30 03:52:54 1.2
@@ -1 +1,6 @@
+
+dnl ## mod_usertrack.c
+AC_CHECK_HEADERS(sys/times.h)
+AC_CHECK_FUNCS(times)
+
APACHE_MODULE(standard)
1.5 +5 -2 apache-2.0/src/modules/standard/mod_usertrack.c
Index: mod_usertrack.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_usertrack.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -u -r1.4 -r1.5
--- mod_usertrack.c 1999/11/29 23:33:06 1.4
+++ mod_usertrack.c 1999/11/30 03:52:54 1.5
@@ -105,6 +105,9 @@
#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 @@
{
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 @@
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. */
1.10 +1 -1 apache-2.0/src/os/win32/os.h
Index: os.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/os/win32/os.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -u -r1.9 -r1.10
--- os.h 1999/11/29 23:33:24 1.9
+++ os.h 1999/11/30 03:52:57 1.10
@@ -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