Subject: everything dumps core and cyrus imapd
To: None <port-sun3@NetBSD.ORG>
From: Michael Richardson <mcr@amaterasu.sandelman.ottawa.on.ca>
List: port-sun3
Date: 09/02/1996 10:10:52
This is a multipart MIME message.

--===_0_Mon_Sep__2_02:48:36_EDT_1996
Content-Type: text/plain; charset=us-ascii


  I had built the Cyrus imapd for NetBSD/sun3. I could not create mailboxes... 
I believe I have tracked this down to its use of mmap(2).
  Cyrus's configure believes that it does not have a useable MAP_SHARED, but 
can do MAP_PRIVATE. Save that it doesn't work. I'm rebuilding with the flags 
set for *no* mmap support to see if that helps. If so, I'll try and reduce 
things to a test program.
  Should MAP_SHARED work? From previous discussions about the i386 port and 
the lack of unified buffer cache/vm system, I believe that it should not. Here
is the test program that configure uses:
  ... oh no! It looks like there are off_t vs unsigned long problems 
veverywhere.


--===_0_Mon_Sep__2_02:48:36_EDT_1996
Content-Type: application/octet-stream
Content-Description: test1.c

#line 1580 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
main() {
char *base;
int fd = open("conftestmmap", O_RDWR|O_CREAT|O_TRUNC, 0666);
if (fd == -1) exit(1);
if (write(fd, "test", 4) != 4) exit(1);
fsync(fd);
base = mmap((caddr_t)0, 100, PROT_READ, MAP_SHARED
#ifdef MAP_FILE
| MAP_FILE
#endif
#ifdef MAP_VARIABLE
| MAP_VARIABLE
#endif
, fd, 0L);
if (base == (caddr_t)-1) exit(1);
if (strncmp(base, "test", 4) != 0) exit(1);
if (write(fd, "test", 4) != 4) exit(1);
fsync(fd);
if (strncmp(base+4, "test", 4) != 0) exit(1);
exit(0);}


--===_0_Mon_Sep__2_02:48:36_EDT_1996--