Bill Pringlemeir wrote: > misc.c:3172: error: `PROT_WRITE' undeclared (first use in this function) > misc.c:3172: warning: assignment makes pointer from integer without a cast > misc.c:3173: error: `MAP_FAILED' undeclared (first use in this function) > misc.c: In function `compat_page_free': > misc.c:3195: warning: implicit declaration of function `munmap' > make[3]: *** [misc.o] Error 1
Public CVS is lagging. > Conditionalizing the compat_page_align(size_t size) routine with "#if > defined(USE_MMAP)" allows a compilation. USE_MMAP means "use mmap() instead of sendfile()". > The other question would be why the configure script didn't pickup the > fact that I have mmap. The file "sys/mmap.h" exists and I have the > manpages for mmap(). There is no check for mmap(). sys/mman.h is always included now. > I think I am compiling with C99 by default. Does GTKG need C95 (not > C89 or C99)?... It needs only C89 + inline. Although it seems Configure doesn't define inline if it's not understood by the compiler. ;( Well, there are a few more requirements like 8-bit chars, 32-bit ints, existence of an 64-bit integer type, transparent pointers etc. but those are also required by GLib and 98% of all other C code. Some code even assumes arithmetic on time_t is meaningful. > but I don't think that any "C" standard really has > semantics related to mmap, does it? Maybe some Unix or Posix defines, > but not STDC type semantics? mmap() is POSIX but siglongjmp() and sigsetjmp() are C90. Of course you could do an existence check for those but if the environment does not claim compliance, those functions or macros may do something completely different. These are only required for resuming from a SIGSEGV or SIGBUS which may happen with memory-mapped files but not for other uses of mmap(). In theory, they are not required at all since the memory-mapped files are only accessed through write() which should fail if, for example, the file was truncated and the accessed page is not valid anymore. However, it's safer to assume that write() could raise a SIGBUS or SIGSEGV. So without them and no sendfile() a plain read() is used instead. -- Christian
pgpRfj376FI7o.pgp
Description: PGP signature
