caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yitzhak Mandelbaum <yitzhak@research.att.com>
To: Eric Cooper <ecc@cmu.edu>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Ocamlnet and EINPROGRESS
Date: Wed, 2 Apr 2008 22:43:07 -0400	[thread overview]
Message-ID: <2E48665C-67B4-4182-BC23-EBA1A6DF9BF6@research.att.com> (raw)
In-Reply-To: <20080403023058.GA22150@stratocaster.home>

[-- Attachment #1: Type: text/plain, Size: 2242 bytes --]

Its a little more complicated than that. The problem arises when  
linking with 1) a library that links with Unix and 2) a file that  
depends on Unix. I've found a minimal example that fails on my system  
(OS X). It involves 4 files: Makefile, mintime.ml, unixprog.ml,  
minprog.ml (names chosen arbitrarily):

########################
Makefile:
########################

all: minprog

timelib.cma: mintime.ml
	ocamlfind ocamlc -package unix -linkpkg \
	-o $@ -a mintime.ml

minprog: timelib.cma  unixprog.ml
	ocamlfind ocamlc $(INCLUDES) -thread -o $@ \
	-package netclient -linkpkg $^ minprog.ml


########################
mintime.ml:
#######################

let now () = Unix.time ()

########################
unixprog.ml:
#######################

let foo x =
   let in_channel, out_channel = Unix.open_process "cat" in
   let read_fd = Unix.descr_of_in_channel in_channel in
   let write_fd = Unix.descr_of_out_channel out_channel in
   ()

########################
minprog.ml:
#######################

let mystring = Http_client.Convenience.http_get "http://www.cnn.com"


Then,

make minprog
./minprog

results in

Fatal error: exception Unix.Unix_error(38, "connect", "")

Yitzhak

On Apr 2, 2008, at 10:30 PM, Eric Cooper wrote:

> On Wed, Apr 02, 2008 at 10:08:55PM -0400, Yitzhak Mandelbaum wrote:
>>    Sure, here's one:
>>
>>    let mystring = Http_client.Convenience.http_get "http:// 
>> www.cnn.com"
>>
>>    But, whether or not it raises the exception depends what I link it
>>    with, which is the essential problem.
>
> On my (Debian) system, I can't build that program without linking in
> the Unix module, since it's referenced by almost all of the ocamlnet
> modules.   So I don't understand the problem you're seeing.
>
> -- 
> Eric Cooper             e c c @ c m u . e d u
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

--------------------------------------------------
Yitzhak Mandelbaum
AT&T Labs - Research

http://www.research.att.com/~yitzhak



[-- Attachment #2: Type: text/html, Size: 8031 bytes --]

  reply	other threads:[~2008-04-03  2:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-03  1:06 Yitzhak Mandelbaum
2008-04-03  1:52 ` [Caml-list] " Eric Cooper
2008-04-03  2:08   ` Yitzhak Mandelbaum
2008-04-03  2:30     ` Eric Cooper
2008-04-03  2:43       ` Yitzhak Mandelbaum [this message]
2008-04-03  7:12         ` Stéphane Glondu
2008-04-03 13:33           ` Dario Teixeira

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=2E48665C-67B4-4182-BC23-EBA1A6DF9BF6@research.att.com \
    --to=yitzhak@research.att.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=ecc@cmu.edu \
    /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).