httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/os/win32 os.h
Date Thu, 08 Jun 2000 00:28:35 GMT
rbb         00/06/07 17:28:35

  Modified:    src      configure.in
               src/main http_main.c
               src/modules/mpm/mpmt_pthread scoreboard.c scoreboard.h
               src/modules/mpm/prefork prefork.c scoreboard.h
               src/modules/mpm/spmt_os2 scoreboard.h spmt_os2.c
               src/modules/standard mod_unique_id.c
               src/os/win32 os.h
  Log:
  Remove all occurances of gettimeofday.  Replace it with ap_now which
  provides the same function but works cross-paltform.
  
  Revision  Changes    Path
  1.47      +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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- configure.in	2000/05/19 23:13:31	1.46
  +++ configure.in	2000/06/08 00:28:31	1.47
  @@ -107,7 +107,6 @@
   strerror \
   initgroups \
   waitpid \
  -gettimeofday \
   memmove \
   bzero \
   )
  
  
  
  1.56      +1 -1      apache-2.0/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_main.c,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- http_main.c	2000/06/05 22:39:02	1.55
  +++ http_main.c	2000/06/08 00:28:32	1.56
  @@ -87,7 +87,7 @@
   #ifdef SECURITY_HOLE_PASS_AUTHORIZATION
       printf(" -D SECURITY_HOLE_PASS_AUTHORIZATION\n");
   #endif
  -#ifdef HAVE_MMAP
  +#ifdef APR_HAS_MMAP
       printf(" -D HAVE_MMAP\n");
   #endif
   #ifdef HAVE_SHMGET
  
  
  
  1.31      +2 -12     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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- scoreboard.c	2000/05/27 22:40:29	1.30
  +++ scoreboard.c	2000/06/08 00:28:32	1.31
  @@ -281,20 +281,10 @@
       ss = &ap_scoreboard_image->servers[child_num][thread_num];
   
       if (status == START_PREQUEST) {
  -      /*ss->start_time = GetCurrentTime(); return time in uS since the 
  -	epoch. Some platforms do not support gettimeofday. Create a routine 
  -	to get the current time is some useful units. */
  -        if (gettimeofday(&ss->start_time, (struct timezone *) 0) < 0) {
  -            ss->start_time.tv_sec = ss->start_time.tv_usec = 0L;
  -        }
  +        ss->start_time = ap_now(); 
       }
       else if (status == STOP_PREQUEST) {
  -      /*ss->stop_time = GetCurrentTime(); 
  -	return time in uS since the epoch */
  -        
  -        if (gettimeofday(&ss->stop_time, (struct timezone *) 0) < 0) {
  -            ss->start_time.tv_sec = ss->start_time.tv_usec = 0L;
  -        }
  +        ss->stop_time = ap_now(); 
       }
       put_scoreboard_info(child_num, thread_num, ss);
   }
  
  
  
  1.17      +2 -7      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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- scoreboard.h	2000/05/27 22:40:29	1.16
  +++ scoreboard.h	2000/06/08 00:28:32	1.17
  @@ -153,13 +153,8 @@
       unsigned long my_bytes_served;
       unsigned long conn_bytes;
       unsigned short conn_count;
  -#ifndef HAVE_GETTIMEOFDAY
  -    clock_t start_time;
  -    clock_t stop_time;
  -#else
  -    struct timeval start_time;
  -    struct timeval stop_time;
  -#endif
  +    ap_time_t start_time;
  +    ap_time_t stop_time;
   #ifdef HAVE_TIMES
       struct tms times;
   #endif
  
  
  
  1.96      +2 -26     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.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- prefork.c	2000/06/02 15:33:18	1.95
  +++ prefork.c	2000/06/08 00:28:33	1.96
  @@ -949,9 +949,6 @@
   void ap_time_process_request(int child_num, int status)
   {
       short_score *ss;
  -#if !defined(HAVE_GETTIMEOFDAY) && defined(HAVE_TIMES)
  -    struct tms tms_blk;
  -#endif
   
       if (child_num < 0)
   	return;
  @@ -960,31 +957,10 @@
       ss = &ap_scoreboard_image->servers[child_num];
   
       if (status == START_PREQUEST) {
  -#if !defined(HAVE_GETTIMEOFDAY)
  -#ifdef HAVE_TIMES
  -	if ((ss->start_time = times(&tms_blk)) == -1)
  -#endif /* HAVE_TIMES */
  -	    ss->start_time = (clock_t) 0;
  -#else
  -	if (gettimeofday(&ss->start_time, (struct timezone *) 0) < 0)
  -	    ss->start_time.tv_sec =
  -		ss->start_time.tv_usec = 0L;
  -#endif
  +	ss->start_time = ap_now();
       }
       else if (status == STOP_PREQUEST) {
  -#if !defined(HAVE_GETTIMEOFDAY)
  -#ifdef HAVE_TIMES
  -	if ((ss->stop_time = times(&tms_blk)) == -1)
  -#endif
  -	    ss->stop_time = ss->start_time = (clock_t) 0;
  -#else
  -	if (gettimeofday(&ss->stop_time, (struct timezone *) 0) < 0)
  -	    ss->stop_time.tv_sec =
  -		ss->stop_time.tv_usec =
  -		ss->start_time.tv_sec =
  -		ss->start_time.tv_usec = 0L;
  -#endif
  -
  +	ss->stop_time = ap_now();
       }
   
       put_scoreboard_info(child_num, ss);
  
  
  
  1.11      +2 -7      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- scoreboard.h	2000/05/27 22:40:30	1.10
  +++ scoreboard.h	2000/06/08 00:28:33	1.11
  @@ -151,13 +151,8 @@
       unsigned long my_bytes_served;
       unsigned long conn_bytes;
       unsigned short conn_count;
  -#if !defined(HAVE_GETTIMEOFDAY)
  -    clock_t start_time;
  -    clock_t stop_time;
  -#else
  -    struct timeval start_time;
  -    struct timeval stop_time;
  -#endif
  +    ap_time_t start_time;
  +    ap_time_t stop_time;
   #ifdef HAVE_TIMES
       struct tms times;
   #endif
  
  
  
  1.10      +2 -7      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- scoreboard.h	2000/05/27 22:40:30	1.9
  +++ scoreboard.h	2000/06/08 00:28:34	1.10
  @@ -145,13 +145,8 @@
       unsigned long my_bytes_served;
       unsigned long conn_bytes;
       unsigned short conn_count;
  -#if !defined(HAVE_GETTIMEOFDAY)
  -    clock_t start_time;
  -    clock_t stop_time;
  -#else
  -    struct timeval start_time;
  -    struct timeval stop_time;
  -#endif
  +    ap_time_t start_time;
  +    ap_time_t stop_time;
   #ifdef HAVE_TIMES
       struct tms times;
   #endif
  
  
  
  1.42      +3 -26     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.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- spmt_os2.c	2000/06/02 15:33:20	1.41
  +++ spmt_os2.c	2000/06/08 00:28:34	1.42
  @@ -292,9 +292,7 @@
   void ap_time_process_request(int child_num, int status)
   {
       short_score *ss;
  -#if !defined(HAVE_GETTIMEOFDAY) && defined(HAVE_TIMES)
  -    struct tms tms_blk;
  -#endif
  +    ap_time_t tms_blk;
   
       if (child_num < 0)
   	return;
  @@ -302,31 +300,10 @@
       ss = &ap_scoreboard_image->servers[child_num];
   
       if (status == START_PREQUEST) {
  -#if !defined(HAVE_GETTIMEOFDAY)
  -#ifdef HAVE_TIMES
  -	if ((ss->start_time = times(&tms_blk)) == -1)
  -#endif /* HAVE_TIMES */
  -	    ss->start_time = (clock_t) 0;
  -#else
  -	if (gettimeofday(&ss->start_time, (struct timezone *) 0) < 0)
  -	    ss->start_time.tv_sec =
  -		ss->start_time.tv_usec = 0L;
  -#endif
  +	ss->start_time = ap_now();
       }
       else if (status == STOP_PREQUEST) {
  -#if !defined(HAVE_GETTIMEOFDAY)
  -#ifdef HAVE_TIMES
  -	if ((ss->stop_time = times(&tms_blk)) == -1)
  -#endif
  -	    ss->stop_time = ss->start_time = (clock_t) 0;
  -#else
  -	if (gettimeofday(&ss->stop_time, (struct timezone *) 0) < 0)
  -	    ss->stop_time.tv_sec =
  -		ss->stop_time.tv_usec =
  -		ss->start_time.tv_sec =
  -		ss->start_time.tv_usec = 0L;
  -#endif
  -
  +	ss->stop_time = ap_now();
       }
   }
   
  
  
  
  1.12      +6 -31     apache-2.0/src/modules/standard/mod_unique_id.c
  
  Index: mod_unique_id.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_unique_id.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- mod_unique_id.c	2000/05/27 22:40:37	1.11
  +++ mod_unique_id.c	2000/06/08 00:28:34	1.12
  @@ -169,9 +169,7 @@
   #endif
       char str[MAXHOSTNAMELEN + 1];
       struct hostent *hent;
  -#ifdef HAVE_GETTIMEOFDAY
  -    struct timeval tv;
  -#endif
  +    ap_time_t tv;
   
       /*
        * Calculate the sizes and offsets in cur_unique_id.
  @@ -232,26 +230,14 @@
        * But protecting against it is relatively cheap.  We just sleep into the
        * next second.
        */
  -#ifndef HAVE_GETTIMEOFDAY
  -    sleep(1);
  -#else
  -    if (gettimeofday(&tv, NULL) == -1) {
  -        sleep(1);
  -    }
  -    else if (tv.tv_usec) {
  -        tv.tv_sec = 0;
  -        tv.tv_usec = 1000000 - tv.tv_usec;
  -        select(0, NULL, NULL, NULL, &tv);
  -    }
  -#endif
  +    tv = ap_now();
  +    ap_sleep(
   }
   
   static void unique_id_child_init(ap_pool_t *p, server_rec *s)
   {
       pid_t pid;
  -#ifdef HAVE_GETTIMEOFDAY
  -    struct timeval tv;
  -#endif
  +    time_t tv;
   
       /*
        * Note that we use the pid because it's possible that on the same
  @@ -283,19 +269,8 @@
        * against restart problems, and a little less protection against a clock
        * going backwards in time.
        */
  -#ifdef HAVE_GETTIMEOFDAY
  -    if (gettimeofday(&tv, NULL) == -1) {
  -        cur_unique_id.counter = 0;
  -    }
  -    else {
  -	/* Some systems have very low variance on the low end of their
  -	 * system counter, defend against that.
  -	 */
  -        cur_unique_id.counter = tv.tv_usec / 10;
  -    }
  -#else
  -    cur_unique_id.counter = 0;
  -#endif
  +    tv = ap_now();
  +    cur_unique_id.counter = tv % APR_USEC_PER_SEC / 10;
   
       /*
        * We must always use network ordering for these bytes, so that
  
  
  
  1.31      +0 -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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- os.h	2000/05/27 05:27:38	1.30
  +++ os.h	2000/06/08 00:28:35	1.31
  @@ -103,7 +103,6 @@
   #define NO_WRITEV
   #define NO_USE_SIGACTION
   /* #undef HAVE_TIMES */
  -/* #undef HAVE_GETTIMEOFDAY */
   #define USE_LONGJMP
   #define HAVE_MMAP
   #define USE_MMAP_SCOREBOARD
  
  
  

Mime
View raw message