AC_CHECK_HEADERS( \
unistd.h \
-sys/times.h \
sys/time.h \
)
#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,
+
+dnl ## mod_usertrack.c
+AC_CHECK_HEADERS(sys/times.h)
+AC_CHECK_FUNCS(times)
+
APACHE_MODULE(standard)
#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;
{
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)
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. */
#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
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
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++;
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 */
struct timeval start_time;
struct timeval stop_time;
#endif
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
struct tms times;
#endif
#ifndef OPTIMIZE_TIMEOUTS
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
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
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)
}
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;
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++;
#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
struct timeval start_time;
struct timeval stop_time;
#endif
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
struct tms times;
#endif
#ifndef OPTIMIZE_TIMEOUTS
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
struct timeval start_time;
struct timeval stop_time;
#endif
-#ifndef NO_TIMES
+#ifdef HAVE_TIMES
struct tms times;
#endif
#ifndef OPTIMIZE_TIMEOUTS
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
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)
}
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;
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++;