Sven Panne <[EMAIL PROTECTED]> wrote,

> [ Simply can't resist...  ;-) ]
> 
> Simon Marlow wrote:
> > The easiest way is to declare mmap as a foreign function using
> > foreign import, then build a little wrapper around it.
> 
> A problem will be: What Haskell types should be used for size_t and
> off_t? Getting this done properly would require autoconf or something
> similar. Perhaps some more Haskell types (Size, Off, ...) should be
> added to the FFI module. I'm not sure which ones exactly and if FFI
> is the right place for it. Opinions?

I don't think that the standard FFI is the right place for
that.  If you are programming the FFI by hand, autoconf is
the right thing to use.  Otherwise, a tool can help.
C->Haskell can compute the right type by analysing the C
headers, ie, feeding it `sys/mman.h'.  H/Direct when fed
`mman.h' might also do the right thing.

It might of course be nice to provide some libraries in
hslibs/ that define access to some of the often used types
and functions.

Manuel

Reply via email to