openbsd-ports/mail/dovecot/patches/patch-configure_in
brad 6310d9ce81 upgrade to Dovecot 0.99.10.5
--
ok MAINTAINER
2004-05-27 16:38:30 +00:00

49 lines
1.3 KiB
Plaintext

$OpenBSD: patch-configure_in,v 1.3 2004/05/27 16:38:30 brad Exp $
--- configure.in.orig 2004-05-26 11:15:53.000000000 -0400
+++ configure.in 2004-05-27 01:24:16.000000000 -0400
@@ -665,6 +665,44 @@ AC_TRY_COMPILE([
AC_MSG_RESULT(no)
])
+dnl * If mmap() plays nicely with write()
+AC_MSG_CHECKING([whether we need to use MS_INVALIDATE with mmaps])
+AC_TRY_RUN([
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/mman.h>
+ int main() {
+ /* return 0 if we're signed */
+ int f = open("conftest.mmap", O_RDWR|O_CREAT|O_TRUNC);
+ void *mem;
+ if (f == -1) {
+ perror("open()");
+ return 1;
+ }
+ write(f, "1", 2);
+ mem = mmap(NULL, 2, PROT_READ|PROT_WRITE, MAP_SHARED, f, 0);
+ if (mem == MAP_FAILED) {
+ perror("mmap()");
+ return 1;
+ }
+ strcpy(mem, "2");
+ msync(mem, 2, MS_SYNC);
+ lseek(f, 0, SEEK_SET);
+ write(f, "3", 2);
+
+ return strcmp(mem, "3") == 0 ? 0 : 1;
+ }
+], [
+ AC_MSG_RESULT(no)
+], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(NEED_MS_INVALIDATE,, Define if your mmap() implementation requires use of MS_INVALIDATE to work with write())
+])
+
+
dnl * Solaris compatible sendfilev()
AC_CHECK_LIB(sendfile, sendfilev, [
LIBS="$LIBS -lsendfile"