From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 0A12EBC57 for ; Fri, 19 Nov 2010 17:30:48 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnoDAE415kzZSMDqgmdsb2JhbACiXBUBAQsLCBoDH707hUsEjWk X-IronPort-AV: E=Sophos;i="4.59,223,1288566000"; d="scan'208";a="79673496" Received: from fmmailgate03.web.de ([217.72.192.234]) by mail4-smtp-sop.national.inria.fr with ESMTP; 19 Nov 2010 17:30:34 +0100 Received: from smtp05.web.de ( [172.20.4.166]) by fmmailgate03.web.de (Postfix) with ESMTP id BABC1174B3FFC; Fri, 19 Nov 2010 17:28:53 +0100 (CET) Received: from [78.43.204.177] (helo=frosties.localdomain) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #24) id 1PJTpV-0000Cp-00; Fri, 19 Nov 2010 17:28:53 +0100 Received: from mrvn by frosties.localdomain with local (Exim 4.72) (envelope-from ) id 1PJTpU-0000JR-R8; Fri, 19 Nov 2010 17:28:53 +0100 From: Goswin von Brederlow To: Dave Scott Cc: 'Goswin von Brederlow' , "caml-list@inria.fr" Subject: Re: [Caml-list] Looking for stubs for sendmsg/recvmsg References: <87d3q21qe4.fsf@frosties.localnet> <81A73678E76EA642801C8F2E4823AD21933254B4C8@LONPMAILBOX01.citrite.net> Date: Fri, 19 Nov 2010 17:28:52 +0100 In-Reply-To: <81A73678E76EA642801C8F2E4823AD21933254B4C8@LONPMAILBOX01.citrite.net> (Dave Scott's message of "Fri, 19 Nov 2010 10:27:13 +0000") Message-ID: <87eiahl1kr.fsf@frosties.localnet> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX18Ta4UmmdsZvB6gOhrk8gSszblDfcz4eHumxy5X WXXDnShWl3CMoY5cxMIInkpkWo/lwXuFAqz5J3Rc+J2nH1ndcX 3TEEphAOI= X-Spam: no; 0.00; stubs:01 citrix:01 stubs:01 const:01 struct:01 flags:01 struct:01 flags:01 bindings:01 mli:01 stub:01 bytecode:01 stub:01 recv:01 sockaddr:01 Dave Scott 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