apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr configure.in
Date Thu, 04 Apr 2002 21:25:05 GMT
trawick     02/04/04 13:25:05

  Modified:    .        configure.in
  Log:
  fix some typos in existing posixsem logic
  
  make sure sem_open actually works before deciding that
  we can use it; some popular levels of Linux have a stub
  sem_open that returns ENOSYS
  
  Revision  Changes    Path
  1.424     +25 -3     apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.423
  retrieving revision 1.424
  diff -u -r1.423 -r1.424
  --- configure.in	4 Apr 2002 18:33:56 -0000	1.423
  +++ configure.in	4 Apr 2002 21:25:05 -0000	1.424
  @@ -1241,7 +1241,29 @@
   AC_CHECK_FUNCS(semget semctl flock)
   APR_CHECK_FILE(/dev/zero)
   AC_CHECK_HEADERS(semaphore.h)
  -AC_CHECK_FUNCS(sem_open sem_close sem_unlink sem_post sem_wait)
  +AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait)
  +
  +dnl Some systems return ENOSYS from sem_open.
  +AC_CACHE_CHECK(for working sem_open,ac_cv_func_sem_open,[
  +AC_TRY_RUN([
  +#include <errno.h>
  +#include <stdlib.h>
  +#include <fcntl.h>
  +#include <semaphore.h>
  +main()
  +{
  +    sem_t *psem;
  +    const char *sem_name = "/apr_autoconf";
  +
  +    psem = sem_open(sem_name, O_CREAT, 0644, 1);
  +    if (psem == (sem_t *)SEM_FAILED) {
  +	exit(1);
  +    }
  +    sem_close(psem);
  +    sem_unlink(sem_name);
  +    exit(0);
  +}], [ac_cv_func_sem_open=yes], [ac_cv_func_sem_open=no],
  +[ac_cv_func_sem_open=no])])
   
   # It's stupid, but not all platforms have union semun, even those that need it.
   AC_MSG_CHECKING(for union semun in sys/sem.h)
  @@ -1328,8 +1350,8 @@
   fi
   
   # See which lock mechanisms we can support on this system.
  -APR_IFALLYES(header:semaphore.h func:sem_open func_sem_close dnl
  -             func_sem_unlink func:sem_post func_sem_wait,
  +APR_IFALLYES(header:semaphore.h func:sem_open func:sem_close dnl
  +             func_sem_unlink func:sem_post func:sem_wait,
                hasposixser="1", hasposixser="0")
   APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1", 
                hassysvser="0")
  
  
  

Mime
View raw message