Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Feb 2004 17:33:04 +0100
From:      Thomas-Martin Seck <tmseck-lists@netcologne.de>
To:        freebsd-ports@freebsd.org
Subject:   Porting libowfat: getting 'syntax error in <sys/mman.h>' on STABLE
Message-ID:  <20040220163304.GB549@laurel.tmseck.homedns.org>

next in thread | raw e-mail | index | archive | help
Hi all,

despite the fact that it's street carnival time in this part of Germany
I work on a port of Felix von Leitner's libowfat library and his gatling
http-daemon. Now I run into the following problem on a 4.9-STABLE box:

===>  Building for local-libowfat-0.17
...
cc -c io/iob_prefetch.c -O -pipe -I.
In file included from io/iob_prefetch.c:3:
/usr/include/sys/mman.h:141: syntax error before `mode_t'
gmake: *** [iob_prefetch.o] Error 1
*** Error code 2

Line 141 of <sys/mman.h>:

int     shm_open __P((const char *, int, mode_t));

io/iob_prefetch.c:

#include "iob_internal.h"
#include <stdio.h>
#include <sys/mman.h>

void iob_prefetch(io_batch* b,uint64 bytes) {
  volatile char x;
  iob_entry* e,* last;
  if (b->bytesleft==0) return;
  last=(iob_entry*)(((char*)array_start(&b->b))+array_bytes(&b->b));
  e=(iob_entry*)array_start(&b->b);
  if (!e) return;
  for (; e<last; ++e) {
    if (e->type==FROMFILE) {
      char* c,* d;
      uint64 before=bytes;
      if (e->n<bytes) bytes=e->n;
      if (e->n>=1000000) {
	long l=e->offset&4095;
	d=c=mmap(0,bytes,PROT_READ,MAP_SHARED,e->fd,(e->offset|4095)+1);
	bytes-=l;
	if (c!=MAP_FAILED) {
	  while (bytes>4095) {
	    x=*d;
	    bytes-=4096;
	    d+=4096;
	  }
	}
	munmap(c,before);
      }
      return;
    }
  }
  (void)x;
}

Could someone tell me what is going wrong here? Everything compiles just
fine on 5.2.RC2.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040220163304.GB549>