caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Olivier Andrieu" <oandrieu@nerim.net>
To: "Joel Reymont" <joelr1@gmail.com>
Cc: "OCaml List" <caml-list@inria.fr>
Subject: Re: [Caml-list] Serious bug in the OCaml FFI?
Date: Sat, 5 May 2007 16:56:41 +0200	[thread overview]
Message-ID: <95513600705050756r49357504v992dd28593159f58@mail.gmail.com> (raw)
In-Reply-To: <307C6D82-55E3-42AD-B0B1-8C1DFC22394A@gmail.com>

On 5/5/07, Joel Reymont <joelr1@gmail.com> wrote:
> I'm using 32-bit Mac OSX 10.4.9 Intel.
>
> I inserted a print-out into my version of socketpair.c [1] and ran my
> OCaml test script
>
>      #use "topfind";;
>      #require "unix";;
>      let x, y = Unix.socketpair Unix.PF_UNIX Unix.SOCK_STREAM 0;;
>      Unix.getpeername y;;
>
> which resulted in
>
>      unix_socketpair: domain = 1, type = 1, proto = 0
>      Exception: Unix.Unix_error (Unix.EAFNOSUPPORT, "", "").
>
> Back at the toplevel
>
>      # (Obj.magic Unix.PF_UNIX:int);;
>      - : int = 0
>
>      # (Obj.magic Unix.SOCK_STREAM:int);;
>      - : int = 0
>
> Now, how exactly does 0 become 1 here?

It doesn't, your printf prints the value of the C constants PF_UNIX
and SOCK_STREAM, which apparently is 1.

-- 
  Olivier


  reply	other threads:[~2007-05-05 14:56 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       ` Olivier Andrieu [this message]
2007-05-05 15:24         ` [Caml-list] " 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=95513600705050756r49357504v992dd28593159f58@mail.gmail.com \
    --to=oandrieu@nerim.net \
    --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).