Browse thread
Looking for stubs for sendmsg/recvmsg
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2010-11-19 (16:30) |
From: | Goswin von Brederlow <goswin-v-b@w...> |
Subject: | Re: [Caml-list] Looking for stubs for sendmsg/recvmsg |
Dave Scott <Dave.Scott@eu.citrix.com> writes: >> Hi, >> >> I'm looking for stubs for >> >> ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags); >> ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags); >> >> Specifically I need those to send (among normal messages) an >> Unix.file_descr over a Unix Domain Socket. >> >> Does anyone know of a module that has them? > > We have some bindings for those: > > https://github.com/xen-org/xen-api-libs/blob/master/stdext/unixext.mli > > external send_fd : Unix.file_descr -> string -> int -> int -> Unix.msg_flag list -> Unix.file_descr -> int = "stub_unix_send_fd_bytecode" "stub_unix_send_fd" > external recv_fd : Unix.file_descr -> string -> int -> int -> Unix.msg_flag list -> int * Unix.sockaddr * Unix.file_descr = "stub_unix_recv_fd" > > You might prefer to extract the relevant functions from the code -- there's a lot of other misc stuff in that repo which you're probably not interested in. > > We use those functions quite a lot so hopefully they'll work for you. > > Cheers, > Dave Neigther one is directly suitable but cut&paste into my own stub is easy enough with that. Thanks Dave and Jérémie. MfG Goswin