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=0.0 required=5.0 tests=AWL 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 70D68BC0A for ; Sat, 5 May 2007 15:51:59 +0200 (CEST) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l45Dpwxx027925 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 5 May 2007 15:51:59 +0200 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1HkJpW-0006DD-00; Sat, 05 May 2007 13:57:42 +0100 Date: Sat, 5 May 2007 13:57:42 +0100 To: Joel Reymont Cc: OCaml List , Gerd Stolpmann Subject: Re: [Caml-list] Re: ocamlnet: EAFNOSUPPORT on Max OSX Message-ID: <20070505125742.GA21369@furbychan.cocan.org> References: <71B2C4B5-3ECB-450F-B015-3C5EAB90855F@gmail.com> <75F71DDF-CACC-4AD9-A3DA-E0049FC9FB2F@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75F71DDF-CACC-4AD9-A3DA-E0049FC9FB2F@gmail.com> User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at discorde with ID 463C8BFE.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocamlnet:01 osx:01 0100,:01 topfind:01 usr:01 lib:01 ocaml:01 val:01 abstr:01 val:01 abstr:01 getsockname:01 getpeername:01 getsockname:01 sockets:01 On Sat, May 05, 2007 at 01:50:09PM +0100, Joel Reymont wrote: > # #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, "", ""). > > # Unix.getpeername x;; > Exception: Unix.Unix_error (Unix.EAFNOSUPPORT, "", ""). You might want to run this under ktrace, but the error seems clear enough from the getsockname man page on Mac OS X: BUGS Names bound to sockets in the UNIX domain are inaccessible; getsockname returns a zero length name. (That differs from the observed behaviour, but returning an error seems more probably than returning a zero length name). In general, I wouldn't expect anonymous Unix domain sockets created by socketpair to have a sockname (they're anonymous!), but I might expect them to have some sort of peername - obviously they don't have that either. Rich. -- Richard Jones Red Hat