1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
|
/*
* LIB/CONFIG.H
*
*
* USE_BSTRING - define if <bstring.h> must be included to get bcopy() and
* related prototypes.
*
*
* NOTE REGARDING USE_SMALL_HASH .. If you wish to set this to continue to
* use small 1 million entry hash tables, set it in lib/vendor.h. As of
* Diablo V1.10, the default dhistory hash table size will be 4 million
* entries.
*
* NOTE REGARDING CHANGING FEATURES: Change these features in LIB/VENDOR.H,
* do *NOT* change these features here unless you are editing this file for
* submission back to me. When adding special features as defaults, the
* operating system version must be explicitly tested.
*
* General notes:
*
* IRIX 6.2 or greater, FreeBSD 2.2 or greater, and Sun/Solaris should
* be able to handle most mmap/shm features, but they have only been tested
* on FreeBSD. Due to the way the code uses READ+WRITE maps, msync()
* is irrelevant so you don't have to worry about that.
*
* All versions of BSDI including 3.0 are known to have serious mmap
* problems even for read-only maps and Diablo may crash the kernel.
*
* Special Features:
*
* USE_PCOMMIT_RW_MAP if mmap() supports shared r+w mmaps, this
* causes diablo to update the precommit cache
* directly rather then with an lseek/write,
* which can reduce filesystem contention.
*
* USE_PCOMMIT_SHM Diablo will use SYSV shared memory for the
* precommit cache. USE_PCOMMIT_RW_MAP is also
* required if you set this option (but it will
* use SYSV shared memory rather then mmap())
*
* USE_SPAM_RW_MAP if mmap() supports shared r+w mmaps, this
* causes diablo to update the spam cache
* directly rather then with an lseek/write,
* which can reduce filesystem contention.
*
* USE_SPAM_SHM Diablo will use SYSV shared memory for the
* spam cache. USE_SPAM_RW_MAP is also required
* if you set this option (but it will use
* SYSV shared memory rather then mmap()).
*
* DO_PCOMMIT_POSTCACHE use the precommit cache as a recent-history
* cache. Suggested only if USE_PCOMMIT_RW_MAP
* or USE_PCOMMIT_SHM are set.
*
*
* USE_ANON_MMAP lib/alloc.c uses MAP_ANON mmap's to allocate
* private memory.
*
* USE_FALL_MMAP lib/alloc.c uses MAP_PRIVATE mmaps on a
* temporary file to allocate private memory.
* (note: the memory winds up being swap-backed
* just like MAP_ANON).
*
* If neither option is set, memory is allocated
* with malloc()/free() but this is not
* recommended if you run more then 10 feeds.
*/
/*
* Edit here
*/
#ifdef __FreeBSD__
#if __FreeBSD__ >= 2
#include <osreldate.h>
#if __FreeBSD_version >= 222001
#define USE_PCOMMIT_SHM 1 /* use sharedmem r/w map vs file map */
#define USE_PCOMMIT_RW_MAP 1 /* use r/w map for pcommit cache */
#define USE_SPAM_SHM 1 /* use sharedmem r/w map vs file map */
#define USE_SPAM_RW_MAP 1 /* use r/w map for spam cache */
#define DO_PCOMMIT_POSTCACHE 1 /* do precommit post caching */
#endif
#endif
#endif
#ifdef sgi
#define USE_PCOMMIT_SHM 1 /* precommit cache in sysv shared mem*/
#define DO_PCOMMIT_POSTCACHE 1 /* do precommit post caching */
#define USE_BSTRING_H 1
#define USE_SYSV_SETPGRP 1
#define USE_SYSV_STATFS 1
#define HAVE_SNPRINTF 0
#define USE_ANON_MMAP 0
#define USE_FALL_MMAP 1
#endif
#ifdef sun
/*
* NOTE: set SUNOS in the master XMakefile.inc if you are running sunos.
*/
#ifdef SUNOS
/*
* sunos
*/
#undef USE_SYSV_SETPGRP
#undef USE_SYSV_STATFS
#define USE_SYSV_SIGNALS 0
#define USE_SYSV_DIR 1
#define USE_SYS_VFS 1
#define HAVE_SNPRINTF 0
#define NEED_TERMIOS 1 /* for TIOCNOTTY */
#define USE_ANON_MMAP 0
#define USE_FALL_MMAP 1
#define USE_STRERROR 1
#define USE_MEMMOVE 1
#else
/*
* solaris
*/
#define USE_PCOMMIT_SHM 1 /* precommit cache in sysv shmem */
#define DO_PCOMMIT_POSTCACHE 1 /* do precommit post caching */
#define USE_SYSV_DIR 1
#define USE_SYSV_SETPGRP 1
/*#define USE_SYSV_STATFS 1 */
#define USE_SUN_STATVFS 1
#define USE_SYSV_SIGNALS 1
#define HAVE_SNPRINTF 0
#define NEED_TERMIOS 1 /* for TIOCNOTTY */
#define USE_ANON_MMAP 0
#define USE_FALL_MMAP 1
#endif
#endif
#ifdef __linux__
#define USE_SYSV_SETPGRP 1
#define USE_SYS_VFS 1
#define USE_PCOMMIT_SHM 1 /* use sharedmem r/w map vs file map */
#define USE_PCOMMIT_RW_MAP 1 /* use r/w map for pcommit cache */
#define USE_SPAM_SHM 1 /* use sharedmem r/w map vs file map */
#define USE_SPAM_RW_MAP 1 /* use r/w map for spam cache */
#define DO_PCOMMIT_POSTCACHE 1 /* do precommit post caching */
/*#define USE_ANON_MMAP 1*/ /* this might work */
#define USE_FALL_MMAP 0
#define HAVE_SNPRINTF 0
#endif
/* AIX notes: snprintf() exists in 4.2 and later. */
#ifdef _AIX
#define USE_BSTRING_H 0
#define USE_SYSV_SETPGRP 1
#define USE_SYSV_STATFS 1
#define USE_SYSV_SIGNALS 1
#define HAVE_SNPRINTF 0
#define USE_ANON_MMAP 1
#define USE_FALL_MMAP 0
#endif
/************************************************************************
* CLEANUP - set defaults for unspecified options *
* (DO NOT EDIT BELOW THIS LINE) *
************************************************************************/
#ifndef USE_BSTRING_H
#define USE_BSTRING_H 0
#endif
#ifndef USE_SYSV_DIR
#define USE_SYSV_DIR 0
#endif
#ifndef USE_SYSV_SIGNALS
#define USE_SYSV_SIGNALS 0
#endif
#ifndef USE_SYSV_SETPGRP
#define USE_SYSV_SETPGRP 0
#endif
#ifndef USE_SYSV_STATFS
#define USE_SYSV_STATFS 0
#endif
#ifndef USE_SYS_VFS
#define USE_SYS_VFS 0
#endif
#ifndef HAVE_SNPRINTF
#define HAVE_SNPRINTF 1
#endif
#ifndef USE_ANON_MMAP
#define USE_ANON_MMAP 0
#endif
#ifndef USE_FALL_MMAP
#define USE_FALL_MMAP 1
#endif
#ifndef USE_STRERROR
#define USE_STRERROR 0
#endif
#ifndef USE_MEMMOVE
#define USE_MEMMOVE 0
#endif
#ifndef USE_SMALL_HASH
#define USE_SMALL_HASH 0
#endif
#ifndef USE_LARGE_HASH
#define USE_LARGE_HASH 0
#endif
#ifndef USE_REALLY_LARGE_HASH
#define USE_REALLY_LARGE_HASH 0
#endif
#ifndef USE_SHORT_REMEMBER
#define USE_SHORT_REMEMBER 0
#endif
#ifndef NEED_TERMIOS
#define NEED_TERMIOS 0
#endif
#ifndef USE_PCOMMIT_RW_MAP
#define USE_PCOMMIT_RW_MAP 0
#endif
#ifndef USE_PCOMMIT_SHM
#define USE_PCOMMIT_SHM 0
#endif
#ifndef USE_SPAM_RW_MAP
#define USE_SPAM_RW_MAP 0
#endif
#ifndef USE_SPAM_SHM
#define USE_SPAM_SHM 0
#endif
#ifndef DO_PCOMMIT_POSTCACHE
#define DO_PCOMMIT_POSTCACHE 0
#endif
#ifndef ACCEPT_ARG3_TYPE
#define ACCEPT_ARG3_TYPE int
#endif
#include <lib/vendor.h>
/*
* force r+w maps if sysv shared memory is used
* for the caches.
*/
#if USE_SPAM_SHM
#undef USE_SPAM_RW_MAP
#define USE_SPAM_RW_MAP 1
#endif
#if USE_PCOMMIT_SHM
#undef USE_PCOMMIT_RW_MAP
#define USE_PCOMMIT_RW_MAP 1
#endif
|