You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Doug MacEachern <do...@covalent.net> on 2000/12/20 05:08:44 UTC
NEED_UNION_SEMUN + 1.3.15-dev breakage
the change from dean below breaks 1.3.15-dev on my system.
2.2.16 kernel leads to -DLINUX=22, which triggers NEED_UNION_SEMUN to be
defined:
+#if LINUX > 20
...
+#define NEED_UNION_SEMUN
http_main.c includes sys/sem.h, which includes sys/sem_buf.h, which
contains:
/* Union used for argument for `semctl'. */
union semun
{
int val; /* value for SETVAL */
struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
unsigned short int *array; /* array for GETALL & SETALL */
struct seminfo *__buf; /* buffer for IPC_INFO */
};
gcc -c -I../os/unix -I../include -DLINUX=22 -DUSE_HSREGEX -DUSE_EXPAT
-I../lib/expat-lite -g `../apaci` http_main.c
http_main.c:694: redefinition of `union semun'
make[3]: *** [http_main.o] Error 1
removing #define NEED_UNION_SEMUN from dean's patch makes everything happy
again.
from CHANGES:
*) Linux 2.2.x and later do not need a serialised single listener,
and sysv semaphores scale better than fcntl. Updated GuessOS
to distinguish 2.0.x from 2.2.x -- 2.0.x will still use fcntl.
[Andrew Morton <an...@uow.edu.au>, Dean Gaudet]
the cvs log:
revision 1.296
date: 2000/11/05 02:56:17; author: dgaudet; state: Exp; lines: +8 -5
linux kernel hackers indicated that it was time
for apache to drop the serialisation on linux; and a
switch to sysv semaphores is preferred for performance.
see <Pi...@twinlark.arctic.org> in
new-httpd archive for more details.
and patch that was applied:
Index: ap_config.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/ap_config.h,v
retrieving revision 1.295
retrieving revision 1.296
diff -u -r1.295 -r1.296
--- ap_config.h 2000/11/03 18:37:54 1.295
+++ ap_config.h 2000/11/05 02:56:17 1.296
@@ -522,12 +522,15 @@
#define HAVE_MMAP 1
#define USE_MMAP_FILES
-/* flock is faster ... but hasn't been tested on 1.x systems */
-/* PR#3531 indicates flock() may not be stable, probably depends on
- * kernel version. Go back to using fcntl, but provide a way for
- * folks to tweak their Configuration to get flock.
+#if LINUX > 20
+/* see Pine.LNX.4.21.0011041233550.1897-100000@twinlark.arctic.org
+ * in new-httpd archives for performance numbers indicating these
+ * are the right choices for linux 2.2.x and later
*/
-#ifndef USE_FLOCK_SERIALIZED_ACCEPT
+#define USE_SYSVSEM_SERIALIZED_ACCEPT
+#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
+#define NEED_UNION_SEMUN
+#else
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif
Re: NEED_UNION_SEMUN + 1.3.15-dev breakage
Posted by "Victor J. Orlikowski" <v....@gte.net>.
Correct, Dean.
Earlier versions define union semun, later ones don't.
FYI, X/Open states that union semun should be defined by the
application, and not the system libraries, which explains the change,
as well as why Solaris does not define it.
Victor
--
Victor J. Orlikowski
======================
v.j.orlikowski@gte.net
vjo@raleigh.ibm.com
vjo@us.ibm.com
Re: NEED_UNION_SEMUN + 1.3.15-dev breakage
Posted by Doug MacEachern <do...@covalent.net>.
On Tue, 19 Dec 2000, dean gaudet wrote:
> so, i suggest trying:
>
> #if _SEM_SEMUN_UNDEFINED
> #define NEED_UNION_SEMUN
> #endif
thanks, looks like the right thing todo, committed.
Re: NEED_UNION_SEMUN + 1.3.15-dev breakage
Posted by dean gaudet <dg...@arctic.org>.
looks like there's glibc brain damage -- i bet some versions define union
semun and others don't. here check this comment from my
/usr/include/bits/sem.h (glibc-2.1.2):
/* The user should define a union like the following to use it for
arguments
for `semctl'.
union semun
{
int val; <= value for SETVAL
struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
unsigned short int *array; <= array for GETALL & SETALL
struct seminfo *__buf; <= buffer for IPC_INFO
};
Previous versions of this file used to define this union but this is
incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
one must define the union or not. */
#define _SEM_SEMUN_UNDEFINED 1
so, i suggest trying:
#if _SEM_SEMUN_UNDEFINED
#define NEED_UNION_SEMUN
#endif
-dean
On Tue, 19 Dec 2000, Doug MacEachern wrote:
> the change from dean below breaks 1.3.15-dev on my system.
> 2.2.16 kernel leads to -DLINUX=22, which triggers NEED_UNION_SEMUN to be
> defined:
>
> +#if LINUX > 20
> ...
> +#define NEED_UNION_SEMUN
>
> http_main.c includes sys/sem.h, which includes sys/sem_buf.h, which
> contains:
> /* Union used for argument for `semctl'. */
> union semun
> {
> int val; /* value for SETVAL */
> struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
> unsigned short int *array; /* array for GETALL & SETALL */
> struct seminfo *__buf; /* buffer for IPC_INFO */
> };
>
> gcc -c -I../os/unix -I../include -DLINUX=22 -DUSE_HSREGEX -DUSE_EXPAT
> -I../lib/expat-lite -g `../apaci` http_main.c
> http_main.c:694: redefinition of `union semun'
> make[3]: *** [http_main.o] Error 1
>
> removing #define NEED_UNION_SEMUN from dean's patch makes everything happy
> again.
>
> from CHANGES:
> *) Linux 2.2.x and later do not need a serialised single listener,
> and sysv semaphores scale better than fcntl. Updated GuessOS
> to distinguish 2.0.x from 2.2.x -- 2.0.x will still use fcntl.
> [Andrew Morton <an...@uow.edu.au>, Dean Gaudet]
>
> the cvs log:
> revision 1.296
> date: 2000/11/05 02:56:17; author: dgaudet; state: Exp; lines: +8 -5
> linux kernel hackers indicated that it was time
> for apache to drop the serialisation on linux; and a
> switch to sysv semaphores is preferred for performance.
> see <Pi...@twinlark.arctic.org> in
> new-httpd archive for more details.
>
> and patch that was applied:
>
> Index: ap_config.h
> ===================================================================
> RCS file: /home/cvs/apache-1.3/src/include/ap_config.h,v
> retrieving revision 1.295
> retrieving revision 1.296
> diff -u -r1.295 -r1.296
> --- ap_config.h 2000/11/03 18:37:54 1.295
> +++ ap_config.h 2000/11/05 02:56:17 1.296
> @@ -522,12 +522,15 @@
> #define HAVE_MMAP 1
> #define USE_MMAP_FILES
>
> -/* flock is faster ... but hasn't been tested on 1.x systems */
> -/* PR#3531 indicates flock() may not be stable, probably depends on
> - * kernel version. Go back to using fcntl, but provide a way for
> - * folks to tweak their Configuration to get flock.
> +#if LINUX > 20
> +/* see Pine.LNX.4.21.0011041233550.1897-100000@twinlark.arctic.org
> + * in new-httpd archives for performance numbers indicating these
> + * are the right choices for linux 2.2.x and later
> */
> -#ifndef USE_FLOCK_SERIALIZED_ACCEPT
> +#define USE_SYSVSEM_SERIALIZED_ACCEPT
> +#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
> +#define NEED_UNION_SEMUN
> +#else
> #define USE_FCNTL_SERIALIZED_ACCEPT
> #endif
>
>
>