caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Joel Reymont <joelr1@gmail.com>
Cc: OCaml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Solved! (was Re: Mac OSX getsocketpair/getsockname and IPv6)
Date: Sun, 06 May 2007 12:05:02 +0200	[thread overview]
Message-ID: <1178445903.17865.25.camel@localhost.localdomain> (raw)
In-Reply-To: <6AC4F0FE-E2D1-4EDD-87A5-2FA3CBB0FBBE@gmail.com>

Am Samstag, den 05.05.2007, 16:16 +0100 schrieb Joel Reymont:
> The culprit is in alloc_sockaddr [1].
> 
> adr->s_gen.sa_family is 0 which stands for AF_UNSPEC in my /usr/ 
> include/sys/socket.h.
> 
> alloc_sockaddr does not handle this family type and throws EAFNOSUPPORT.
> 
> I'm inclined to think that ocamlnet should be fixed and not the OCaml  
> library, although it would be helpful if an error different from  
> EAFNOSUPPORT was used.

Yes, this is true, EAFNOSUPPORT is misleading because it means that the
whole address family is not supported. A better code would be EOPNOTSUPP
which is generally used when a certain socket operation cannot be
performed for the type of socket (and the Single Unix Spec documents it
for getsockname/getpeername). Or Unix.sockaddr is extended by an extra
case for the inaccessible address.


>    default:
>      if (close_on_error != -1) close (close_on_error);
>      unix_error(EAFNOSUPPORT, "", Nothing);
>    }

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


  reply	other threads:[~2007-05-06 10:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-05 12:40 ocamlnet: EAFNOSUPPORT on Max OSX Joel Reymont
2007-05-05 12:50 ` Joel Reymont
2007-05-05 12:57   ` [Caml-list] " Richard Jones
2007-05-05 14:00     ` 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         ` Gerd Stolpmann [this message]
2007-05-28 17:08         ` [Caml-list] " 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=1178445903.17865.25.camel@localhost.localdomain \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --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).