[Haskell-cafe] ByteStrings, FFI, iovec
johan.tibell at gmail.com
Sat Mar 28 17:19:14 EDT 2009
On Sat, Mar 28, 2009 at 7:59 PM, Antoine Latter <aslatter at gmail.com> wrote:
> I'm putting together an FFI layer to a library which uses writev for
> its IO, and so expects an array of iovec structs as an argument to one
> of its calls. for more information, check out "man writev".
> Since I'm already using Data.Binary, the writev call almost sounds
> like a perfect match for lazy bytestrings, so I thought I'd put up
> what I have for comments. I'm using c2hs. The recursive nesting of
> 'withForeignPtr' put me off at first, but I thought I'd at least give
> it a shot. I haven't put this into practice yet, so it could be
> buggy. I'm more looking for comments on the approach.
network-bytestring  includes a FFI wrapper for iovecs that might be
useful to look at.
More information about the Haskell-Cafe