You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/10/24 09:48:48 UTC

[PATCH] Break everything

This is a "it's better to break multiplatform stuff early in the beta
cycle" patch.  It's a bunch of portability patches.

PR#849 AIX now uses USE_FCNTL_SERIALIZED_ACCEPT.  If this doesn't work
somewhere, we want to know now.

PR#1267 The AIX/memmove thing was a red herring... we already #define
memmove bcopy in regex for *i386 AIX*... which is what the user was
reporting on.  So do the same thing in conf.h.

PR#482, 1246: Various versions of HPUX require Spencer regex.  Why guess,
why torment ourselves.  Just get it over with, force them all to
have Spencer regex.

PR#977: Some versions of NetBSD don't define __NetBSD__.  Clean up the
FreeBSD/NetBSD selection code in Configure (the i486 and non-i486 stuff
was the same), and define NETBSD to make sure this works.

PR#1249: Unixware 2.x requires -lgen for syslog.

Ultrix appears to not have syslog (I seem to recall this from the days
that I used to work on ultrix as well...).

Gemini port.

All SVR4 systems have really similar headers, so NET_SIZE_T = size_t
is probably correct for all of them.  Similarly they're supposed to
have shmget().  Given that shmget() means better reliability let's
try defining it for all of them.  (Martin, ISTR you saying that
either shmget or mmap worked for you, I think shmget is more
conservative given that it works on solaris and hpux too.)

Flame away.

Dean

Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apachen/src/CHANGES,v
retrieving revision 1.470
diff -u -r1.470 CHANGES
--- CHANGES	1997/10/22 08:26:50	1.470
+++ CHANGES	1997/10/24 07:41:41
@@ -1,5 +1,17 @@
 Changes with Apache 1.3b3
 
+  *) PORT: AIX now uses USE_FCNTL_SERIALIZED_ACCEPT. PR#849
+     PORT: i386 AIX does not have memmove. PR#1267
+     PORT: HPUX now defaults to using Spencer regex.  PR#482, 1246
+     PORT: Some versions of netbsd don't automatically define
+	    __NetBSD__.  Workaround by defining NETBSD. PR#977
+     PORT: Unixware 2.x requires -lgen for syslog. PR#1249
+     PORT: Ultrix appears to not have syslog.
+     PORT: Basic Gemini port (treat it like unixware212).
+     PORT: All SVR4 systems now use NET_SIZE_T = size_t, and
+	    use HAVE_SHMGET.
+     [Dean Gaudet]
+
   *) Various improvements in detecting config file errors (missing closing
      directives for <Directory>, <Files> etc. blocks, prohibiting global
      server settings in <VirtualHost> blocks, flagging unhandled multiple
Index: Configure
===================================================================
RCS file: /export/home/cvs/apachen/src/Configure,v
retrieving revision 1.161
diff -u -r1.161 Configure
--- Configure	1997/10/21 06:41:07	1.161
+++ Configure	1997/10/24 07:41:41
@@ -223,10 +223,12 @@
     *-hp-hpux10.*)
 	OS='HP-UX 10'
 	CFLAGS="$CFLAGS -DHPUX10"
+	DEF_WANTHSREGEX=yes
 	;;
     *-hp-hpux*)
 	OS='HP-UX'
 	CFLAGS="$CFLAGS -DHPUX"
+	DEF_WANTHSREGEX=yes
 	;;
     *-sgi-irix64)
 # Note: We'd like to see patches to compile 64-bit, but for now...
@@ -304,14 +306,15 @@
 	DBM_LIB=""
 	DB_LIB=""
 	;;
-    *486-*-freebsd*|*486-*-netbsd*)
-	OS='FreeBSD/NETBSD on 486'
+    *-netbsd*)
+	OS='NetBSD'
+	CFLAGS="$CFLAGS -DNETBSD"
 	LIBS="$LIBS -lcrypt"
 	DBM_LIB=""
 	DB_LIB=""
 	;;
-    *-freebsd*|*-netbsd*)
-	OS='FreeBSD/NetBSD'
+    *-freebsd*)
+	OS='FreeBSD'
 	LIBS="$LIBS -lcrypt"
 	DBM_LIB=""
 	DB_LIB=""
@@ -398,17 +401,17 @@
 	DEF_WANTHSREGEX=yes
 	OS='Unixware'
 	CFLAGS="$CFLAGS -DSVR4 -DNO_LINGCLOSE"
-	LIBS="$LIBS -lsocket -lnsl -lcrypt"
+	LIBS="$LIBS -lsocket -lnsl -lcrypt -lgen"
 	;;
     *-unixware211)
 	OS='Unixware 2.1.1'
 	CFLAGS="$CFLAGS -DUW"
-	LIBS="$LIBS -lsocket -lnsl -lcrypt"
+	LIBS="$LIBS -lsocket -lnsl -lcrypt -lgen"
 	;;
     *-unixware212)
 	OS='Unixware 2.1.2'
 	CFLAGS="$CFLAGS -DUW"
-	LIBS="$LIBS -lsocket -lnsl -lcrypt"
+	LIBS="$LIBS -lsocket -lnsl -lcrypt -lgen"
 	DBM_LIB=""
 	;;
     maxion-*-sysv4*)
@@ -419,7 +422,7 @@
 	;;
     *-sni-sysv4*)
 	OS='SVR4'
-	CFLAGS="$CFLAGS -DSVR4 -D_XPG_IV -DHAVE_MMAP"
+	CFLAGS="$CFLAGS -DSVR4 -D_XPG_IV"
 	DEF_WANTHSREGEX=yes
 	LIBS="$LIBS -lsocket -lnsl -lc"
 	;;
Index: helpers/GuessOS
===================================================================
RCS file: /export/home/cvs/apachen/src/helpers/GuessOS,v
retrieving revision 1.31
diff -u -r1.31 GuessOS
--- GuessOS	1997/10/02 05:24:58	1.31
+++ GuessOS	1997/10/24 07:41:41
@@ -178,6 +178,11 @@
 	echo "${MACHINE}-whatever-sysv4"; exit 0
 	;;
 
+    UnixWare:5:99*:*)
+	# Gemini, beta release of next rev of unixware
+	echo "${MACHINE}-whatever-unixware212"; exit 0
+	;;
+
     DYNIX/ptx:4*:*)
 	echo "${MACHINE}-whatever-sysv4"; exit 0
 	;;
Index: main/conf.h
===================================================================
RCS file: /export/home/cvs/apachen/src/main/conf.h,v
retrieving revision 1.149
diff -u -r1.149 conf.h
--- conf.h	1997/10/22 20:29:34	1.149
+++ conf.h	1997/10/24 07:41:41
@@ -200,6 +200,10 @@
 #ifdef NEED_RLIM_T
 typedef int rlim_t;
 #endif
+#define USE_FCNTL_SERIALIZED_ACCEPT
+#ifdef USEBCOPY
+#define memmove(a,b,c) bcopy(b,a,c)
+#endif
 
 #elif defined(ULTRIX)
 #define HAVE_GMTOFF
@@ -211,7 +215,6 @@
 #ifndef __ultrix__		/* Hack to check for pre-Ultrix 4.4 cc */
 #define const			/* Not implemented */
 #endif
-#define HAVE_SYSLOG
 
 #elif defined(OSF1)
 #define HAVE_GMTOFF
@@ -397,9 +400,8 @@
 /* A lot of SVR4 systems need this */
 #define USE_FCNTL_SERIALIZED_ACCEPT
 #define HAVE_SYSLOG
-#ifdef SNI  /* SINIX/ReliantUNIX, probably other SVR4's as well */
 #define NET_SIZE_T size_t
-#endif /*SNI*/
+#define HAVE_SHMGET
 
 #elif defined(UW)
 #define NO_LINGCLOSE
@@ -433,7 +435,7 @@
 #define ap_inet_addr inet_network
 #define HAVE_SYSLOG
 
-#elif defined(__NetBSD__) || defined(__OpenBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(NETBSD)
 #define HAVE_SYS_RESOURCE_H
 #define HAVE_GMTOFF
 #undef NO_KILLPG


Re: [PATCH] Break everything

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Mon, Oct 27, 1997 at 11:29:55AM -0800, Dean Gaudet wrote:
> By my count it saved 5 system calls ...

Even more because non-mmap()ed files are served in units of 8k (read+write)
while the mmap()ed writev does all in one chunk. Plus an extra read()
to detect EOF is saved.

    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: [PATCH] Break everything

Posted by Dean Gaudet <dg...@arctic.org>.

On Fri, 24 Oct 1997, Martin Kraemer wrote:

> Some months ago, one of you (Jim? you?) said that when both MMAP and
> SHMGET were available, then mmap() was the better choice. But I don't
> recall the reasoning behind it.
> Anyway: The shmget version runs just as good as the mmap version.

I'm not sure there's a goodness or badness of either.

> If it's true that mmap() is the better choice, I'd rather leave it in.
> And, after looking at your misc/perf-tune.html document, I tried
> USE_MMAP_FILES. Works perfectly, even on my 1992 i386-SVR4.0 (deejai).

+1 on USE_MMAP_FILES for all SVR4 until shown otherwise that it's bogus.

> PS: For you SVR4 users on this list: here's an edited sdiff of apache
> serving one request. The right column shows the system calls for apache
> with USE_MMAP_FILES defined. Where the left column shows a system call
> and the right column is empty, using USE_MMAP_FILES saved a system call.

By my count it saved 5 system calls ...

Dean


Re: [PATCH] Break everything

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Fri, Oct 24, 1997 at 12:48:48AM -0700, Dean Gaudet wrote:
> 
> All SVR4 systems have really similar headers, so NET_SIZE_T = size_t
> is probably correct for all of them.  Similarly they're supposed to
> have shmget().  Given that shmget() means better reliability let's
> try defining it for all of them.  (Martin, ISTR you saying that
> either shmget or mmap worked for you, I think shmget is more
> conservative given that it works on solaris and hpux too.)

First of all, no compile problems here after applying your patches.

> +     PORT: All SVR4 systems now use NET_SIZE_T = size_t, and

+1 for that.

> +	    use HAVE_SHMGET.

Some months ago, one of you (Jim? you?) said that when both MMAP and
SHMGET were available, then mmap() was the better choice. But I don't
recall the reasoning behind it.
Anyway: The shmget version runs just as good as the mmap version.

> @@ -419,7 +422,7 @@
>  	;;
>      *-sni-sysv4*)
>  	OS='SVR4'
> -	CFLAGS="$CFLAGS -DSVR4 -D_XPG_IV -DHAVE_MMAP"
> +	CFLAGS="$CFLAGS -DSVR4 -D_XPG_IV"
>  	DEF_WANTHSREGEX=yes
>  	LIBS="$LIBS -lsocket -lnsl -lc"
>  	;;
If it's true that mmap() is the better choice, I'd rather leave it in.
And, after looking at your misc/perf-tune.html document, I tried
USE_MMAP_FILES. Works perfectly, even on my 1992 i386-SVR4.0 (deejai).

So I'd even suggest
> +     CFLAGS="$CFLAGS -DSVR4 -D_XPG_IV -DUSE_MMAP_FILES"

but I cannot say if it works for all SVR4's out there. Anyone?

    Martin

PS: For you SVR4 users on this list: here's an edited sdiff of apache
serving one request. The right column shows the system calls for apache
with USE_MMAP_FILES defined. Where the left column shows a system call
and the right column is empty, using USE_MMAP_FILES saved a system call.

...many streams initializations deleted...
read(3, "GET /Welcome.shtml.de HTTP/1.0\r"..., 4096) = 32       read(3, "GET /Welcome.shtml.de HTTP/1.0\r"..., 4096) = 32
sigaction(SIGUSR1, {SIG_IGN}, {SIG_IGN}) = 0                    sigaction(SIGUSR1, {SIG_IGN}, {SIG_IGN}) = 0
time()                                  = 877695777           | time()                                  = ....
read(3, "\r\n", 4096)                   = 2			read(3, "\r\n", 4096)                   = 2
xstat(2, "/var/WWW/Web//Welcome.shtml.de", {st_mode=S_IFREG|0	xstat(2, "/var/WWW/Web//Welcome.shtml.de", {st_mode=S_IFREG|0
open("/var/WWW/Web//Welcome.shtml.de", O_RDONLY) = 4		open("/var/WWW/Web//Welcome.shtml.de", O_RDONLY) = 4
fstatvfs(0x4, 0x8045350, 0x8002e14c, 0x8085e9c, 0x8085e9c) =  <
ioctl(4, TCGETA, 0x8045322)             = -1 ENOTTY (Not a ty <
read(4, "<!DOCTYPE HTML PUBLIC \"-//W3C//"..., 8192) = 8192   | mmap(0, 8457, PROT_READ, MAP_PRIVATE, 4, 0) = 0x8007c000
writev(3, [{"HTTP/1.1 200 OK\r\nDate: Fri, 24"..., 265}, {"<! | writev(3, [{"HTTP/1.1 200 OK\r\nDate: Fri, 24"..., 265}, {"<!
read(4, "Dokument!!\" -->\n  <H6>Diese Se"..., 8192) = 265    <
fxstat(2, 0, {st_mode=S_IFCHR|0622, st_rdev=makedev(12, 14),  <
read(4, "", 8192)                       = 0		      <
close(4)                                = 0			close(4)                                = 0
poll([{fd=3, events=POLLRDNORM}], 1, 0) = 0                   <
write(3, "Dokument!!\" -->\n  <H6>Diese Se"..., 265) = 265    <
time()                                  = 8776.....             time()                                  = 877695778
write(20, "127.0.0.1 - - [24/Oct/1997:10:46"..., 85) = 85     | write(20, "127.0.0.1 - - [24/Oct/1997:12:22"..., 85) = 85
...
close(3)                                = 0			close(3)                                = 0
sigaction(SIGUSR1, {0x8001a198, [], 0}, {SIG_IGN}) = 0		sigaction(SIGUSR1, {0x8001a198, [], 0}, {SIG_IGN}) = 0
							      >	munmap(0x8007c000, 8457)                = 0
ioctl(23, I_FIND, "sockmod")            = -1 ENOTTY (Not a ty	ioctl(23, I_FIND, "sockmod")            = -1 ENOTTY (Not a ty

-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request