$NetBSD$

--- src/main/http_core.c.orig	2009-03-04 09:50:54.000000000 +0300
+++ src/main/http_core.c
@@ -4176,8 +4176,18 @@ static int default_handler(request_rec *
 	&& (!r->header_only || (d->content_md5 & 1))) {
 	/* we need to protect ourselves in case we die while we've got the
  	 * file mmapped */
+#ifdef NTO
+	/* 
+		MAP_NOSYNCFILE is required for mmap() on regular files,
+		MAP_ELF is just a workaround for a bug in 6.1 (fails on MAP_PRIVATE)
+		It appears to give some 10% performance boost nevertheless
+	*/
+	mm = mmap(NULL, r->finfo.st_size, PROT_READ, 
+		  MAP_PRIVATE|MAP_NOSYNCFILE|MAP_ELF, fileno(f), 0);
+#else
 	mm = mmap(NULL, r->finfo.st_size, PROT_READ, MAP_PRIVATE,
 		  fileno(f), 0);
+#endif
 	if (mm == (caddr_t)-1) {
 	    ap_log_rerror(APLOG_MARK, APLOG_CRIT, r,
 			 "default_handler: mmap failed: %s", r->filename);
