From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id C3CCBBC0A for ; Sat, 5 May 2007 15:53:59 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l45Drxpf028242 for ; Sat, 5 May 2007 15:53:59 +0200 Received: by ug-out-1314.google.com with SMTP id k3so713906ugf for ; Sat, 05 May 2007 06:53:59 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=gr+tT3eagF+ZVYv3knjC3VouMH3zVbbZtSXiggJzbI6SpBN3kQY98EaMtfqhaJMoLQymnrC5JyvZHyMc/TCOBPeaR0+KgkgCJHtT0R8KV7zPBDLwSQRhjuFS0mrxTn7GxzbsRcV+P9LwcRZ+gbNSR1nmBGBbwLhIxnEcrs9Kxo0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=aKHM161l2m9rqPrqVWH9VvrRUN28LKqdudvFRqHWyBktlAlQ9r1u3+jQau+lGibX1yni5V5k14FjXYRNgL/BbJoVKyv7jV36sCileWpUnrKLTcHcCuiQ5l8Drv6Wb3G63J47IgSeDQkY4/LwdY9M6ANe0tTglMvXw2C057c58aY= Received: by 10.82.180.17 with SMTP id c17mr8299908buf.1178373238990; Sat, 05 May 2007 06:53:58 -0700 (PDT) Received: from ?192.168.1.33? ( [83.34.3.221]) by mx.google.com with ESMTP id 24sm7363703ugf.2007.05.05.06.53.57; Sat, 05 May 2007 06:53:58 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <75F71DDF-CACC-4AD9-A3DA-E0049FC9FB2F@gmail.com> References: <71B2C4B5-3ECB-450F-B015-3C5EAB90855F@gmail.com> <75F71DDF-CACC-4AD9-A3DA-E0049FC9FB2F@gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Joel Reymont Subject: Mac OSX getsocketpair/getsockname and IPv6 Date: Sat, 5 May 2007 14:53:48 +0100 To: OCaml List X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 463C8C77.000 on discorde : j-chkmail score : XXX : 5/20 1 0.000 -> 3 X-Miltered: at discorde with ID 463C8C77.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; osx:01 getsockname:01 otherlibs:01 socketaddr:01 ocaml:01 topfind:01 usr:01 lib:01 ocaml:01 val:01 abstr:01 val:01 abstr:01 getsockname:01 recompile:01 The test C program [1] runs fine. I also tried extracting the relevant C bits from otherlibs/unix/{socket.c, socketaddr.h, etc.} and putting them together. Again, everything is fine but the following OCaml code still bombs out. Objective Caml version 3.10+dev26 (2007-04-25) # #use "topfind";; - : unit = () # #require "unix";; /usr/local/lib/ocaml/unix.cma: loaded # let x, y = Unix.socketpair Unix.PF_UNIX Unix.SOCK_STREAM 0;; val x : Unix.file_descr = val y : Unix.file_descr = # Unix.getsockname x;; Exception: Unix.Unix_error (Unix.EAFNOSUPPORT, "", ""). I'm baffled but it definitely has something to do with IPv6 code in OCaml. I'll try to recompile 3.10 without IPv6 support to see if it works and then will try to insert printouts into the C wrappers for socketpair and getsockname to see what OCaml is giving C with IPv6 enabled. Thanks, Joel [1] Sample C program: #include #include #include int main (int argc, char** argv) { int err, sv[2]; struct sockaddr addr; socklen_t addr_len; err = socketpair(PF_UNIX, SOCK_STREAM, 0, sv); printf("socketpair: %d\n", err); addr_len = sizeof(addr); err = getsockname(sv[0], &addr, &addr_len); printf("getsockname: %d\n", err); } -- http://wagerlabs.com/