jim 98/01/22 16:36:44
Modified: htdocs/manual upgrading_to_1_3.html
htdocs/manual/misc FAQ.html perf-tuning.html
htdocs/manual/mod core.html
src CHANGES PORTING
src/main conf.h http_main.c
src/os/win32 os.h
Log:
Submitted by: Jim Jagielski
Best of both worlds... Let the world know if we have mmap and/or
shmget as well as controlling which to use for scoreboard. This
should be a complete patch, so if any docs were skipped, feel free
to update 'em
Revision Changes Path
1.8 +0 -10 apachen/htdocs/manual/upgrading_to_1_3.html
Index: upgrading_to_1_3.html
===================================================================
RCS file: /export/home/cvs/apachen/htdocs/manual/upgrading_to_1_3.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- upgrading_to_1_3.html 1998/01/22 23:43:48 1.7
+++ upgrading_to_1_3.html 1998/01/23 00:36:29 1.8
@@ -58,16 +58,6 @@
<li><code>mod_auth_msql</code> has been removed from the distribution.
- <li>Some #defines changed names for clarity. Specifically,
- we want to make sure that developers know that we are
- using shared memory for specific purposes and not as
- a general "we have this capability" notice:
-
-<pre>
- HAVE_MMAP -> USE_MMAP_SCOREBOARD
- HAVE_SHMGET -> USE_SHMGET_SCOREBOARD
-</pre>
-
</ul>
<h3>Run-Time Configuration Changes</h3>
1.99 +4 -4 apachen/htdocs/manual/misc/FAQ.html
Index: FAQ.html
===================================================================
RCS file: /export/home/cvs/apachen/htdocs/manual/misc/FAQ.html,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- FAQ.html 1998/01/22 23:18:56 1.98
+++ FAQ.html 1998/01/23 00:36:30 1.99
@@ -15,7 +15,7 @@
<!--#include virtual="header.html" -->
<H1 ALIGN="CENTER">Apache Server Frequently Asked Questions</H1>
<P>
- $Revision: 1.98 $ ($Date: 1998/01/22 23:18:56 $)
+ $Revision: 1.99 $ ($Date: 1998/01/23 00:36:30 $)
</P>
<P>
The latest version of this FAQ is always available from the main
@@ -1805,9 +1805,9 @@
As a last-resort workaround, you can
comment out the <CODE>#define USE_SHMGET_SCOREBOARD</CODE> definition in
the
<SAMP>LINUX</SAMP> section of
- <SAMP>src/conf.h</SAMP> and rebuild the server (prior to 1.3b4 the
- definition was named <CODE>#define HAVE_SHMGET</CODE>). This will produce
- a server which is slower and less reliable.
+ <SAMP>src/conf.h</SAMP> and rebuild the server (prior to 1.3b4, simply
+ removing <CODE>#define HAVE_SHMGET</CODE> would have sufficed). This will
+ produce a server which is slower and less reliable.
</P>
<HR>
</LI>
1.5 +6 -5 apachen/htdocs/manual/misc/perf-tuning.html
Index: perf-tuning.html
===================================================================
RCS file: /export/home/cvs/apachen/htdocs/manual/misc/perf-tuning.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- perf-tuning.html 1998/01/22 23:11:49 1.4
+++ perf-tuning.html 1998/01/23 00:36:32 1.5
@@ -494,10 +494,11 @@
on-disk file. The on-disk file is not only slow, but it is unreliable
(and less featured). Peruse the <code>src/main/conf.h</code> file
for your architecture and look for either <code>USE_MMAP_SCOREBOARD</code> or
-<code>USE_SHMGET_SCOREBOARD</code>. Defining one of those two enables the
-supplied shared memory code. If your system has another type of
-shared memory then edit the file <code>src/main/http_main.c</code> and
-add the hooks necessary to use it in Apache. (Send us back a patch
+<code>USE_SHMGET_SCOREBOARD</code>. Defining one of those two (as
+well as their companions <code>HAVE_MMAP</code> and <code>HAVE_SHMGET</code>
+respectively) enables the supplied shared memory code. If your system has
+another type of shared memory, edit the file
<code>src/main/http_main.c</code>
+and add the hooks necessary to use it in Apache. (Send us back a patch
too please.)
<p>Historical note: The Linux port of Apache didn't start to use
@@ -706,7 +707,7 @@
<p>It may even be the case that <code>mmap</code> isn't
used on your architecture, if so then defining <code>USE_MMAP_FILES</code>
-might work (if it works then report back to us).
+and <code>HAVE_MMAP</code> might work (if it works then report back to us).
<p>Apache does its best to avoid copying bytes around in memory. The
first write of any request typically is turned into a <code>writev</code>
1.91 +6 -4 apachen/htdocs/manual/mod/core.html
Index: core.html
===================================================================
RCS file: /export/home/cvs/apachen/htdocs/manual/mod/core.html,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- core.html 1998/01/22 23:18:58 1.90
+++ core.html 1998/01/23 00:36:34 1.91
@@ -1477,15 +1477,17 @@
Apache 1.2 and above:<p>
-Linux 1.x users might be able to add <code>-DUSE_SHMGET_SCOREBOARD</code> to
+Linux 1.x users might be able to add
+<code>-DHAVE_SHMGET -DUSE_SHMGET_SCOREBOARD</code> to
the <code>EXTRA_CFLAGS</code> in your <code>Configuration</code>. This
might work with some 1.x installations, but won't work with all of
-them. (Prior to 1.3b4 this define was named <code>HAVE_SHMGET</code>.)<p>
+them. (Prior to 1.3b4, <code>HAVE_SHMGET</code> would have sufficed.)<p>
-SVR4 users should consider adding <code>-DUSE_SHMGET_SCOREBOARD</code> to the
+SVR4 users should consider adding
+<code>-DHAVE_SHMGET -DUSE_SHMGET_SCOREBOARD</code> to the
<code>EXTRA_CFLAGS</code> in your <code>Configuration</code>. This
is believed to work, but we were unable to test it in time for 1.2
-release. (Prior to 1.3b4 this define was named <code>HAVE_SHMGET</code>.)<p>
+release. (Prior to 1.3b4, <code>HAVE_SHMGET</code> would have sufficed.)<p>
<strong>See Also</strong>:
<a href="../stopping.html">Stopping and Restarting Apache</a></p>
1.592 +10 -6 apachen/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apachen/src/CHANGES,v
retrieving revision 1.591
retrieving revision 1.592
diff -u -r1.591 -r1.592
--- CHANGES 1998/01/22 23:23:06 1.591
+++ CHANGES 1998/01/23 00:36:36 1.592
@@ -1,13 +1,17 @@
Changes with Apache 1.3b4
- *) For clarity the following compile time definitions were changed, folks
- with custom compilation options in their Configuration should make
- appropriate changes:
+ *) For clarity the following compile time definition was changed:
SAFE_UNSERIALIZED_ACCEPT -> SINGLE_LISTEN_UNSERIALIZED_ACCEPT
- HAVE_MMAP -> USE_MMAP_SCOREBOARD
- HAVE_SHMGET -> USE_SHMGET_SCOREBOARD
-
+
+ Also, for example, HAVE_MMAP would mean to use mmap() scoreboards
+ and not be a general notice that the OS has mmap(). Now the
+ HAVE_MMAP/SHMGET #defines strictly are informational that the
+ OS has that method of shared memory; the type to use for
+ the scoreboard is a seperate #define (USE_MMAP_SCOREBOARD
+ and USE_SHMGET_SCOREBOARD). This allows outside modules to
+ determine if shared memory is available and allows Apache
+ to determine the best method to use for the scoreboard.
[Jim Jagielski]
*) PORT: UnixWare 2.1.2 SMP appears to require USE_FCNTL_SERIALIZED_ACCEPT,
1.19 +19 -3 apachen/src/PORTING
Index: PORTING
===================================================================
RCS file: /export/home/cvs/apachen/src/PORTING,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- PORTING 1998/01/22 23:11:54 1.18
+++ PORTING 1998/01/23 00:36:37 1.19
@@ -140,6 +140,7 @@
#undef NO_SETSID
#define HAVE_SYS_SELECT_H
#define JMP_BUF sigjmp_buf
+ #define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
typedef int rlim_t;
@@ -170,6 +171,12 @@
HAVE_*:
Does this OS have/support this capability?
+ HAVE_MMAP:
+ The OS has a working mmap() implementation
+
+ HAVE_SHMGET:
+ The OS has a working shmget() (SystemV shared memory) implementation
+
HAVE_GMTOFF:
Define if the OS's tm struct has the tm_gmtoff element
@@ -203,12 +210,14 @@
Define if the OS supports the BSD mmap() call. This is used by various
OSs to allow the scoreboard file to be held in shared mmapped-memory
instead of a real file. Note that this is only used to determine
- if mmap should be used for shared memory.
+ if mmap should be used for shared memory. If HAVE_MMAP is not
+ #defined, this will automatically be unset.
USE_SHMGET_SCOREBOARD:
Define if the OS has the SysV-based shmget() family of shared-memory
functions. Used to allow the scoreboard to live in a shared-memory
- slot instead of a real file.
+ slot instead of a real file. If HAVE_SHMGET is not #defined,
+ this will automatically be unset.
<<NOTE: If neither USE_MMAP_SCOREBOARD or USE_SHMGET_SCOREBOARD
is defined, a file-based scoreboard will be used and
@@ -219,7 +228,8 @@
(as well as setjmp() instead of sigsetjmp()).
USE_MMAP_FILES:
- Enable the use of mmap() for sending static files.
+ Enable the use of mmap() for sending static files. If HAVE_MMAP
+ is not #defined, this will automatically be unset.
USE_*_SERIALIZED_ACCEPT:
See htdocs/manual/misc/perf-tuning.html for an in-depth discussion of
@@ -262,6 +272,12 @@
NO_*:
These are defined if the OS does NOT have the specified function or if
we should not use it.
+
+ NO_SHMGET:
+ Do not use shmget() (SystemV shared memory) at all.
+
+ NO_MMAP:
+ Do not use mmap() at all.
NO_UNISTD_H:
1.175 +35 -1 apachen/src/main/conf.h
Index: conf.h
===================================================================
RCS file: /export/home/cvs/apachen/src/main/conf.h,v
retrieving revision 1.174
retrieving revision 1.175
diff -u -r1.174 -r1.175
--- conf.h 1998/01/22 23:11:57 1.174
+++ conf.h 1998/01/23 00:36:40 1.175
@@ -95,6 +95,7 @@
#define NO_SETSID
#define NO_KILLPG
#define NO_WRITEV
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
#define SHM_R 0400 /* Read permission */
#define SHM_W 0200 /* Write permission */
@@ -119,6 +120,7 @@
#undef NO_SETSID
char *crypt(const char *pw, const char *salt);
char *mktemp(char *template);
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#include <sys/time.h>
@@ -145,6 +147,7 @@
#endif
#endif
#define NEED_UNION_SEMUN
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define HAVE_CRYPT_H
@@ -160,7 +163,9 @@
#if !defined(USE_FCNTL_SERIALIZED_ACCEPT) &&
!defined(USE_USLOCK_SERIALIZED_ACCEPT)
#define USE_SYSVSEM_SERIALIZED_ACCEPT
#endif
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
+#define HAVE_MMAP
#define USE_MMAP_FILES
#define HAVE_CRYPT_H
#define NO_LONG_DOUBLE
@@ -176,6 +181,7 @@
#ifndef _HIUX_SOURCE
#define _HIUX_SOURCE
#endif
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
#define SELECT_NEEDS_CAST
#define HAVE_SYSLOG
@@ -189,6 +195,7 @@
#ifndef _HPUX_SOURCE
#define _HPUX_SOURCE
#endif
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
#define HAVE_SYSLOG
#ifndef HPUX10
@@ -202,6 +209,7 @@
#undef NO_SETSID
#define HAVE_SYS_SELECT_H
#ifndef __ps2__
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define HAVE_SYSLOG
@@ -235,6 +243,7 @@
#define HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define HAVE_CRYPT_H
@@ -247,6 +256,7 @@
#define HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define HAVE_CRYPT_H
@@ -351,7 +361,9 @@
#define NET_SIZE_T socklen_t
#endif
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
+#define HAVE_MMAP
#define USE_MMAP_FILES
#define HAVE_SYS_RESOURCE_H
@@ -388,6 +400,7 @@
#define SIGURG SIGUSR1
#define HAVE_SYS_SELECT_H
#define USE_FCNTL_SERIALIZED_ACCEPT
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define HAVE_SYS_RESOURCE_H
@@ -421,6 +434,7 @@
/* fcntl() locking is expensive with NFS */
#define USE_FLOCK_SERIALIZED_ACCEPT
#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
/*
* NOTE: If when you run Apache under A/UX and you get a warning
@@ -449,10 +463,12 @@
#endif
#define HAVE_SYSLOG
#define NET_SIZE_T size_t
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
#ifdef _OSD_POSIX /* BS2000-POSIX mainframe does not have syslog and needs
initgroups */
#define NEED_INITGROUPS
#undef HAVE_SYSLOG
+#undef HAVE_SHMGET
#undef USE_SHMGET_SCOREBOARD
#endif /*_OSD_POSIX*/
@@ -465,8 +481,10 @@
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
#define HAVE_RESOURCE
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
#define HAVE_CRYPT_H
#define HAVE_SYS_SELECT_H
@@ -531,6 +549,7 @@
#define HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#ifndef DEFAULT_USER
@@ -563,6 +582,7 @@
#define NEED_PROCESS_H
#define HAVE_SYS_SELECT_H
#include <unix.h>
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define HAVE_SYSLOG
@@ -598,6 +618,7 @@
#define HAVE_RESOURCE 1
#define bzero(a,b) memset(a,0,b)
#define USE_FCNTL_SERIALIZED_ACCEPT
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define HAVE_CRYPT_H
@@ -614,6 +635,7 @@
#define chdir _chdir2
#include <sys/time.h>
#define MAXSOCKETS 4096
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define NO_RELIABLE_PIPED_LOGS
@@ -632,6 +654,7 @@
#define USE_LONGJMP
#undef NEED_STRDUP
#else
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif
@@ -642,6 +665,7 @@
#undef NO_KILLPG
#undef NO_SETSID
#undef NEED_STRDUP
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define HAVE_SYSLOG
@@ -655,6 +679,7 @@
#include <net/errno.h>
#define NO_KILLPG
#undef NO_SETSID
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
#define SIGURG SIGUSR1
#define USE_FCNTL_SERIALIZED_ACCEPT
@@ -662,6 +687,7 @@
#elif defined(NEWSOS)
#define HAVE_SYS_RESOURCE_H
+#define HAVE_SHMGET
#define USE_SHMGET_SCOREBOARD
#define USE_LONGJMP
#define NO_SETSID
@@ -863,8 +889,16 @@
#define MAP_ANON MAP_ANONYMOUS
#endif
-#if defined(USE_MMAP_SCOREBOARD) && defined(NO_MMAP)
+#if defined(USE_MMAP_FILES) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
+#undef USE_MMAP_FILES
+#endif
+
+#if defined(USE_MMAP_SCOREBOARD) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
#undef USE_MMAP_SCOREBOARD
+#endif
+
+#if defined(USE_SHMGET_SCOREBOARD) && (defined(NO_SHMGET) ||
!defined(HAVE_SHMGET))
+#undef USE_SHMGET_SCOREBOARD
#endif
#ifndef LOGNAME_MAX
1.273 +8 -1 apachen/src/main/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
retrieving revision 1.272
retrieving revision 1.273
diff -u -r1.272 -r1.273
--- http_main.c 1998/01/22 23:11:58 1.272
+++ http_main.c 1998/01/23 00:36:41 1.273
@@ -1384,7 +1384,8 @@
* this #ifdef section must be ABOVE the next one (BSD style).
*
* I tested this stuff and it works fine for me, but if it provides
- * trouble for you, just comment out USE_MMAP_SCOREBOARD in QNX section of
conf.h
+ * trouble for you, just comment out USE_MMAP_SCOREBOARD in QNX section
+ * of conf.h
*
* June 5, 1997,
* Igor N. Kovalenko -- [EMAIL PROTECTED]
@@ -2802,6 +2803,12 @@
#endif
#ifdef HTTPD_ROOT
printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n");
+#endif
+#ifdef HAVE_MMAP
+ printf(" -D HAVE_MMAP\n");
+#endif
+#ifdef HAVE_SHMGET
+ printf(" -D HAVE_SHMGET\n");
#endif
#ifdef USE_MMAP_SCOREBOARD
printf(" -D USE_MMAP_SCOREBOARD\n");
1.11 +1 -0 apachen/src/os/win32/os.h
Index: os.h
===================================================================
RCS file: /export/home/cvs/apachen/src/os/win32/os.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- os.h 1998/01/22 23:12:04 1.10
+++ os.h 1998/01/23 00:36:43 1.11
@@ -25,6 +25,7 @@
#define NO_GETTIMEOFDAY
//#define NEED_PROCESS_H although we do, this is specially handled in
conf.h
#define USE_LONGJMP
+#define HAVE_MMAP
#define USE_MMAP_SCOREBOARD
#define MULTITHREAD
#define HAVE_CANONICAL_FILENAME