cvs commit: apache-2.0/src/lib/apr/mmap/unix common.c mmap.c mmap_h.h

1999-11-13 Thread dreid
dreid   99/11/12 16:07:26

  Modified:src/lib/apr aclocal.m4 configure.in
   src/lib/apr/include apr_mmap.h
   src/lib/apr/mmap/beos mmap.c mmap_h.h
   src/lib/apr/mmap/unix common.c mmap.c mmap_h.h
  Log:
  hange the way that we test for the size of ssize_t, using code suggested by
  Ralf after I found that the test failed on FreeBSD.
  
  Update the mmap code to use a much simpler API than previously.  I'll
  add documentation as well as support for this in http_core.c over the
  weekend.
  
  Revision  ChangesPath
  1.6   +27 -1 apache-2.0/src/lib/apr/aclocal.m4
  
  Index: aclocal.m4
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/aclocal.m4,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- aclocal.m41999/11/10 18:27:02 1.5
  +++ aclocal.m41999/11/13 00:07:04 1.6
  @@ -133,6 +133,32 @@
   ])dnl
   fi
   rm -fr conftest*])
  -
  +dnl A variant of AC_CHECK_SIZEOF which allows the checking of
  +dnl sizes of non-builtin types
  +dnl AC_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE])
  +AC_DEFUN(AC_CHECK_SIZEOF_EXTENDED,
  +[changequote(,)dnl
  +dnl The name to #define
  +define(AC_TYPE_NAME, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl
  +dnl The cache variable
  +define(AC_CV_NAME, translit(ac_cv_sizeof_$2, [ *],[p]))dnl
  +changequote([, ])dnl
  +AC_MSG_CHECKING(size of $2)
  +AC_CACHE_VAL(AC_CV_NAME,
  +[AC_TRY_RUN([#include stdio.h
  +$1
  +main()
  +{
  +  FILE *f=fopen(conftestval,w);
  +  if (!f) exit(1);
  +  fprintf(f, %d\n, sizeof($2));
  +  exit(0);
  +}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,,
  +AC_CV_NAME=$3))])dnl
  +AC_MSG_RESULT($AC_CV_NAME)
  +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
  +undefine([AC_TYPE_NAME])dnl
  +undefine([AC_CV_NAME])dnl
  +])
   
   
  
  
  
  1.25  +1 -12 apache-2.0/src/lib/apr/configure.in
  
  Index: configure.in
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- configure.in  1999/11/10 13:40:51 1.24
  +++ configure.in  1999/11/13 00:07:05 1.25
  @@ -57,18 +57,7 @@
   AC_CHECK_SIZEOF(long double, 12)
   AC_CHECK_SIZEOF(long long, 8)
   
  -MY_TRY_RUN([
  -#include sys/types.h 
  -#include stdlib.h 
  -#include stdio.h
  -
  -int main() {
  -return(sizeof(ssize_t));
  -} 
  -],
  -AC_DEFINE(SIZEOF_SSIZE_T, 4), 
  -AC_DEFINE_UNQUOTED(SIZEOF_SSIZE_T, $?),
  -AC_DEFINE(SIZEOF_SSIZE_T, 4))
  +AC_CHECK_SIZEOF_EXTENDED([#include sys/types.h], ssize_t, 8)
   
   # Use /bin/sh if it exists, otherwise go looking for sh in the path
   if test .$SH = . -a -f /bin/sh; then
  
  
  
  1.4   +3 -9  apache-2.0/src/lib/apr/include/apr_mmap.h
  
  Index: apr_mmap.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_mmap.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apr_mmap.h1999/11/04 12:33:39 1.3
  +++ apr_mmap.h1999/11/13 00:07:12 1.4
  @@ -71,19 +71,13 @@
   /*   Function definitions */
   
   /* creation */
  -ap_status_t ap_mmap_create(ap_mmap_t ** newmmap, const char *fname, 
ap_context_t *cntxt);
  -ap_status_t ap_mmap_open_create(ap_mmap_t **newmmap, ap_file_t *file, 
ap_context_t *cntxt);
  -ap_status_t ap_mmap_size_create(ap_mmap_t **newmmap, ap_file_t *file, 
ap_size_t size,
  -ap_context_t *cntxt);
  +ap_status_t ap_mmap_create(ap_mmap_t ** newmmap, ap_file_t *file, ap_off_t 
offset,
  + ap_size_t size, ap_context_t *cntxt);
   
   /* destruction */
   ap_status_t ap_mmap_delete(ap_mmap_t *mmap);
   
  -/* These are designed to be used in qsort, bsearch etc */
  -ap_int32_t ap_mmap_inode_compare(const void *m1, const void *m2);
  -ap_int32_t ap_mmap_filename_compare(const void *m1, const void *m2);
  -
  -ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_size_t offset);
  +ap_status_t ap_mmap_offset(void **addr, ap_mmap_t *mmap, ap_off_t offset);
   
   #ifdef __cplusplus
   }
  
  
  
  1.5   +13 -126   apache-2.0/src/lib/apr/mmap/beos/mmap.c
  
  Index: mmap.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/mmap/beos/mmap.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mmap.c1999/11/04 12:33:40 1.4
  +++ mmap.c1999/11/13 00:07:16 1.5
  @@ -79,151 +79,38 @@
   return errno;
   }
   
  -ap_status_t ap_mmap_create(struct mmap_t **new, const char *fname,
  - ap_context_t *cont)
  +ap_status_t ap_mmap_create(struct mmap_t **new, ap_file_t *file, ap_off_t 
offset, ap_size_t size,
  +ap_context_t *cont)
   {
  -struct stat st;
 

cvs commit: apache-2.0/src/lib/apr/file_io/unix dir.c

1999-11-13 Thread jim
jim 99/11/13 06:39:54

  Modified:src/lib/apr acconfig.h configure.in
   src/lib/apr/file_io/unix dir.c
  Log:
  Handle the fact that FreeBSD has threaded functions in
  libc_r and not libpthread
  
  Revision  ChangesPath
  1.12  +2 -0  apache-2.0/src/lib/apr/acconfig.h
  
  Index: acconfig.h
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/acconfig.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- acconfig.h1999/11/10 13:40:52 1.11
  +++ acconfig.h1999/11/13 14:39:51 1.12
  @@ -39,6 +39,8 @@
   #undef USE_PROC_PTHREAD_SERIALIZE
   #undef USE_PTHREAD_SERIALIZE
   
  +#undef READDIR_IS_THREAD_SAFE
  +
   #undef NEED_RLIM_T
   #undef USEBCOPY
   
  
  
  
  1.26  +5 -0  apache-2.0/src/lib/apr/configure.in
  
  Index: configure.in
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/configure.in,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- configure.in  1999/11/13 00:07:05 1.25
  +++ configure.in  1999/11/13 14:39:52 1.26
  @@ -86,7 +86,11 @@
   AC_DEFINE_UNQUOTED($ac_decision) 
   
   AC_CHECK_LIB(pthread, pthread_mutex_init, AC_DEFINE(USE_PTHREAD_SERIALIZE))
  +AC_CHECK_LIB(c_r, pthread_mutex_init, AC_DEFINE(USE_PTHREAD_SERIALIZE))
  +ac_cv_define_READDIR_IS_THREAD_SAFE=no
  +AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE))
   
  +
   case $OS in
  *-os2*)
  CFLAGS=$CFLAGS -DOS2 -Zmt
  @@ -104,6 +108,7 @@
   
   AC_CHECK_LIB(dl, dlopen)
   AC_CHECK_LIB(pthread, pthread_mutex_init)
  +AC_CHECK_LIB(c_r, pthread_mutex_init)
   AC_CHECK_LIB(socket,socket)
   AC_CHECK_LIB(crypt,crypt)
   AC_CHECK_LIB(ufc,crypt)
  
  
  
  1.16  +2 -1  apache-2.0/src/lib/apr/file_io/unix/dir.c
  
  Index: dir.c
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/dir.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- dir.c 1999/11/04 07:26:20 1.15
  +++ dir.c 1999/11/13 14:39:53 1.16
  @@ -124,7 +124,8 @@
*/
   ap_status_t ap_readdir(struct dir_t *thedir)
   {
  -#if APR_HAS_THREADS  defined(_POSIX_THREAD_SAFE_FUNCTIONS)
  +#if APR_HAS_THREADS  defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
  + !defined(READDIR_IS_THREAD_SAFE)
   ap_status_t ret;
   ret = readdir_r(thedir-dirstruct, thedir-entry, thedir-entry);
   /* Avoid the Linux problem where at end-of-directory thedir-entry