caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Joel Reymont <joelr1@gmail.com>
Cc: OCaml List <caml-list@inria.fr>, Gerd Stolpmann <gerd@gerd-stolpmann.de>
Subject: Re: [Caml-list] Re: ocamlnet: EAFNOSUPPORT on Max OSX
Date: Sat, 5 May 2007 13:57:42 +0100	[thread overview]
Message-ID: <20070505125742.GA21369@furbychan.cocan.org> (raw)
In-Reply-To: <75F71DDF-CACC-4AD9-A3DA-E0049FC9FB2F@gmail.com>

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 = <abstr>
> val y : Unix.file_descr = <abstr>
> 
> # 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


  reply	other threads:[~2007-05-05 13:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-05 12:40 Joel Reymont
2007-05-05 12:50 ` Joel Reymont
2007-05-05 12:57   ` Richard Jones [this message]
2007-05-05 14:00     ` [Caml-list] " Joel Reymont
2007-05-05 13:53   ` Mac OSX getsocketpair/getsockname and IPv6 Joel Reymont
2007-05-05 14:13     ` Serious bug in the OCaml FFI? Joel Reymont
2007-05-05 14:56       ` [Caml-list] " Olivier Andrieu
2007-05-05 15:24         ` Joel Reymont
2007-05-05 14:31     ` Mac OSX getsocketpair/getsockname and IPv6 Joel Reymont
2007-05-05 15:16       ` Solved! (was Re: Mac OSX getsocketpair/getsockname and IPv6) Joel Reymont
2007-05-06 10:05         ` [Caml-list] " Gerd Stolpmann
2007-05-28 17:08         ` Paul Snively
2007-05-05 14:46     ` Mac OSX getsocketpair/getsockname and IPv6 Joel Reymont

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070505125742.GA21369@furbychan.cocan.org \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    --cc=gerd@gerd-stolpmann.de \
    --cc=joelr1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).