You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@hyperreal.org on 2000/01/24 14:59:03 UTC

cvs commit: apache-2.0/src/lib/apr/locks/unix locks.h

rbb         00/01/24 05:59:03

  Modified:    src/lib/apr acconfig.h configure.in
               src/lib/apr/include apr.h.in apr_portable.h
               src/lib/apr/locks/unix locks.h
  Log:
  Namespace protect the HAVE_SEMUN variable that was added.  This has not
  been tested fully, because I don't have access to a platform that uses
  semaphores, but the logic is sound.
  
  Revision  Changes    Path
  1.21      +0 -1      apache-2.0/src/lib/apr/acconfig.h
  
  Index: acconfig.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/acconfig.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- acconfig.h	2000/01/11 12:58:46	1.20
  +++ acconfig.h	2000/01/24 13:58:59	1.21
  @@ -27,7 +27,6 @@
   @TOP@
   
   /* Various #defines we need to know about */
  -#undef HAVE_STRUCT_UNION_SEMUN
   #undef HAVE_LOCK_EX
   #undef HAVE_F_SETLK
   #undef HAVE_PTHREAD_PROCESS_SHARED
  
  
  
  1.47      +6 -3      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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- configure.in	2000/01/23 01:13:44	1.46
  +++ configure.in	2000/01/24 13:58:59	1.47
  @@ -221,6 +221,7 @@
   AC_CHECK_HEADERS(osreldate.h)
   AC_CHECK_HEADERS(process.h)
   AC_CHECK_HEADERS(pwd.h)
  +AC_CHECK_HEADERS(sys/sem.h)
   AC_CHECK_HEADERS(setjmp.h)
   AC_CHECK_HEADERS(signal.h)
   AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0")
  @@ -285,10 +286,12 @@
   ],[
   union semun arg;
   semctl(0, 0, 0, arg);
  -], [AC_DEFINE(HAVE_STRUCT_UNION_SEMUN) union_semun=yes]
  -msg=yes,dnl
  -msg=no)
  +], [have_union_semun="1" union_semun=yes ]
  +msg=yes, [
  +have_union_semun="0"
  +msg=no ] )
   AC_MSG_RESULT([$msg])
  +AC_SUBST(have_union_semun)
   
   AC_MSG_CHECKING(looking for in_addr in netinet/in.h)
   AC_TRY_COMPILE([
  
  
  
  1.10      +1 -0      apache-2.0/src/lib/apr/include/apr.h.in
  
  Index: apr.h.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr.h.in,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- apr.h.in	2000/01/19 01:14:55	1.9
  +++ apr.h.in	2000/01/24 13:59:01	1.10
  @@ -43,6 +43,7 @@
   #define APR_HAVE_IN_ADDR        @have_in_addr@
   #define APR_HAVE_INET_ADDR      @inet_addr@
   #define APR_HAVE_INET_NETWORK   @inet_network@
  +#define APR_HAVE_UNION_SEMUN    @have_union_semun@
   
   #if APR_HAVE_SYS_TYPES_H
   #include <sys/types.h>
  
  
  
  1.20      +1 -1      apache-2.0/src/lib/apr/include/apr_portable.h
  
  Index: apr_portable.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_portable.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- apr_portable.h	2000/01/23 01:13:45	1.19
  +++ apr_portable.h	2000/01/24 13:59:01	1.20
  @@ -81,7 +81,7 @@
   #if APR_HAVE_PTHREAD_H
   #include <pthread.h>
   #endif
  -#ifdef HAVE_STRUCT_UNION_SEMUN
  +#if APR_HAVE_UNION_SEMUN
   #include <sys/sem.h>
   #endif
   
  
  
  
  1.10      +1 -4      apache-2.0/src/lib/apr/locks/unix/locks.h
  
  Index: locks.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/locks.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- locks.h	2000/01/23 01:13:47	1.9
  +++ locks.h	2000/01/24 13:59:02	1.10
  @@ -88,9 +88,6 @@
   #if HAVE_FCNTL_H
   #include <fcntl.h>
   #endif
  -#ifdef HAVE_STRUCT_UNION_SEMUN
  -#include <sys/sem.h>
  -#endif
   
   #if APR_HAS_THREADS
   #if HAVE_PTHREAD_H
  @@ -99,7 +96,7 @@
   #endif
   /* End System Headers */
   
  -#ifndef HAVE_STRUCT_UNION_SEMUN
  +#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE
   /* it makes no sense, but this isn't defined on solaris */
   union semun {
       long val;
  
  
  

Re: cvs commit: apache-2.0/src/lib/apr/locks/unix locks.h

Posted by Ben Laurie <be...@algroup.co.uk>.
rbb@apache.org wrote:
> 
> > >   -#ifdef HAVE_STRUCT_UNION_SEMUN
> > >   -#include <sys/sem.h>
> > >   -#endif
> > >
> > >    #if APR_HAS_THREADS
> > >    #if HAVE_PTHREAD_H
> > >   @@ -99,7 +96,7 @@
> > >    #endif
> > >    /* End System Headers */
> > >
> > >   -#ifndef HAVE_STRUCT_UNION_SEMUN
> > >   +#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE
> > >    /* it makes no sense, but this isn't defined on solaris */
> > >    union semun {
> > >        long val;
> >
> > Que? If you don't include sys/sem.h, then this doesn't compile - why did
> > you remove it?
> 
> If you look about four lines above this,. we include sys/sem.h if it is on
> the system.  The problem was we weren't checking for it.  I put the check
> into configure.in, so we should be including it.  I just didn't see a need
> for sys/sem.h to be included twice.  :-)

Aha! :-)

In which case, it'd make sense to use HAVE_SYS_SEM_H for the other one,
too.

> > BTW, why are these structures included in the locking structure at all?
> > They're essentially constant static structures, but they currently exist
> > in each lock.
> >
> 
> I have no good answer for this.  I'll look into it though.

:-)

Cheers,

Ben.

--
SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm

http://www.apache-ssl.org/ben.html

Y19100 no-prize winner!
http://www.ntk.net/index.cgi?back=2000/now0121.txt

Re: cvs commit: apache-2.0/src/lib/apr/locks/unix locks.h

Posted by Ben Laurie <be...@algroup.co.uk>.
rbb@apache.org wrote:
> 
> > >   -#ifdef HAVE_STRUCT_UNION_SEMUN
> > >   -#include <sys/sem.h>
> > >   -#endif
> > >
> > >    #if APR_HAS_THREADS
> > >    #if HAVE_PTHREAD_H
> > >   @@ -99,7 +96,7 @@
> > >    #endif
> > >    /* End System Headers */
> > >
> > >   -#ifndef HAVE_STRUCT_UNION_SEMUN
> > >   +#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE
> > >    /* it makes no sense, but this isn't defined on solaris */
> > >    union semun {
> > >        long val;
> >
> > Que? If you don't include sys/sem.h, then this doesn't compile - why did
> > you remove it?
> 
> If you look about four lines above this,. we include sys/sem.h if it is on
> the system.  The problem was we weren't checking for it.  I put the check
> into configure.in, so we should be including it.  I just didn't see a need
> for sys/sem.h to be included twice.  :-)

Aha! :-)

In which case, it'd make sense to use HAVE_SYS_SEM_H for the other one,
too.

> > BTW, why are these structures included in the locking structure at all?
> > They're essentially constant static structures, but they currently exist
> > in each lock.
> >
> 
> I have no good answer for this.  I'll look into it though.

:-)

Cheers,

Ben.

--
SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm

http://www.apache-ssl.org/ben.html

Y19100 no-prize winner!
http://www.ntk.net/index.cgi?back=2000/now0121.txt

Re: cvs commit: apache-2.0/src/lib/apr/locks/unix locks.h

Posted by rb...@apache.org.
> >   -#ifdef HAVE_STRUCT_UNION_SEMUN
> >   -#include <sys/sem.h>
> >   -#endif
> > 
> >    #if APR_HAS_THREADS
> >    #if HAVE_PTHREAD_H
> >   @@ -99,7 +96,7 @@
> >    #endif
> >    /* End System Headers */
> > 
> >   -#ifndef HAVE_STRUCT_UNION_SEMUN
> >   +#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE
> >    /* it makes no sense, but this isn't defined on solaris */
> >    union semun {
> >        long val;
> 
> Que? If you don't include sys/sem.h, then this doesn't compile - why did
> you remove it?

If you look about four lines above this,. we include sys/sem.h if it is on
the system.  The problem was we weren't checking for it.  I put the check
into configure.in, so we should be including it.  I just didn't see a need
for sys/sem.h to be included twice.  :-)

> 
> BTW, why are these structures included in the locking structure at all?
> They're essentially constant static structures, but they currently exist
> in each lock.
> 

I have no good answer for this.  I'll look into it though.

Ryan


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------


Re: cvs commit: apache-2.0/src/lib/apr/locks/unix locks.h

Posted by rb...@apache.org.
> >   -#ifdef HAVE_STRUCT_UNION_SEMUN
> >   -#include <sys/sem.h>
> >   -#endif
> > 
> >    #if APR_HAS_THREADS
> >    #if HAVE_PTHREAD_H
> >   @@ -99,7 +96,7 @@
> >    #endif
> >    /* End System Headers */
> > 
> >   -#ifndef HAVE_STRUCT_UNION_SEMUN
> >   +#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE
> >    /* it makes no sense, but this isn't defined on solaris */
> >    union semun {
> >        long val;
> 
> Que? If you don't include sys/sem.h, then this doesn't compile - why did
> you remove it?

If you look about four lines above this,. we include sys/sem.h if it is on
the system.  The problem was we weren't checking for it.  I put the check
into configure.in, so we should be including it.  I just didn't see a need
for sys/sem.h to be included twice.  :-)

> 
> BTW, why are these structures included in the locking structure at all?
> They're essentially constant static structures, but they currently exist
> in each lock.
> 

I have no good answer for this.  I'll look into it though.

Ryan


Come to the first official Apache Software Foundation
Conference!!!   <http://ApacheCon.Com/>

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------


Re: cvs commit: apache-2.0/src/lib/apr/locks/unix locks.h

Posted by Ben Laurie <be...@algroup.co.uk>.
rbb@hyperreal.org wrote:
>   1.10      +1 -4      apache-2.0/src/lib/apr/locks/unix/locks.h
> 
>   Index: locks.h
>   ===================================================================
>   RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/locks.h,v
>   retrieving revision 1.9
>   retrieving revision 1.10
>   diff -u -r1.9 -r1.10
>   --- locks.h   2000/01/23 01:13:47     1.9
>   +++ locks.h   2000/01/24 13:59:02     1.10
>   @@ -88,9 +88,6 @@
>    #if HAVE_FCNTL_H
>    #include <fcntl.h>
>    #endif
>   -#ifdef HAVE_STRUCT_UNION_SEMUN
>   -#include <sys/sem.h>
>   -#endif
> 
>    #if APR_HAS_THREADS
>    #if HAVE_PTHREAD_H
>   @@ -99,7 +96,7 @@
>    #endif
>    /* End System Headers */
> 
>   -#ifndef HAVE_STRUCT_UNION_SEMUN
>   +#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE
>    /* it makes no sense, but this isn't defined on solaris */
>    union semun {
>        long val;

Que? If you don't include sys/sem.h, then this doesn't compile - why did
you remove it?

BTW, why are these structures included in the locking structure at all?
They're essentially constant static structures, but they currently exist
in each lock.

Cheers,

Ben.

--
SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm

http://www.apache-ssl.org/ben.html

Y19100 no-prize winner!
http://www.ntk.net/index.cgi?back=2000/now0121.txt

Re: cvs commit: apache-2.0/src/lib/apr/locks/unix locks.h

Posted by Ben Laurie <be...@algroup.co.uk>.
rbb@hyperreal.org wrote:
>   1.10      +1 -4      apache-2.0/src/lib/apr/locks/unix/locks.h
> 
>   Index: locks.h
>   ===================================================================
>   RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/locks.h,v
>   retrieving revision 1.9
>   retrieving revision 1.10
>   diff -u -r1.9 -r1.10
>   --- locks.h   2000/01/23 01:13:47     1.9
>   +++ locks.h   2000/01/24 13:59:02     1.10
>   @@ -88,9 +88,6 @@
>    #if HAVE_FCNTL_H
>    #include <fcntl.h>
>    #endif
>   -#ifdef HAVE_STRUCT_UNION_SEMUN
>   -#include <sys/sem.h>
>   -#endif
> 
>    #if APR_HAS_THREADS
>    #if HAVE_PTHREAD_H
>   @@ -99,7 +96,7 @@
>    #endif
>    /* End System Headers */
> 
>   -#ifndef HAVE_STRUCT_UNION_SEMUN
>   +#if !APR_HAVE_UNION_SEMUN && APR_USE_SYSVSEM_SERIALIZE
>    /* it makes no sense, but this isn't defined on solaris */
>    union semun {
>        long val;

Que? If you don't include sys/sem.h, then this doesn't compile - why did
you remove it?

BTW, why are these structures included in the locking structure at all?
They're essentially constant static structures, but they currently exist
in each lock.

Cheers,

Ben.

--
SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm

http://www.apache-ssl.org/ben.html

Y19100 no-prize winner!
http://www.ntk.net/index.cgi?back=2000/now0121.txt