Version française
Home     About     Download     Resources     Contact us    
Browse thread
Matching problem?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: malc <av1474@c...>
Subject: Re: [Caml-list] Matching problem?
On Tue, 14 Aug 2007, Kiran Pamnany wrote:

> Thanks for the response.
>
>>> ...
>>> begin try
>>>   syscall (fun () -> Unix.connect s ...
>>>   ...
>>> with
>>>   Unix.Unix_error(UNIX.EINPROGRESS,_,_) -> ...
>>>   | Unix.Unix_error(e,_,_) -> ...
>>>   | err -> prerr_endline (Printexc.to_string err)
>>> done;
>>> ...
>>>
>>> The output for this is:
>>>
>>> Unix.Unix_error(38, "connect", "")
>>>
>>> How is this possible?
>>
>> I am just guessing, but the exception handler for the second case calls
>> Unix.close on line 963, which could raise a further exception that would
>> not get caught. Also some of the Unix.xxx calls before the begin..try
>> block could raise an exception. The odd thing is you're getting
>> Unix_error(_, "connect", _), i.e., as if the actual call to Unix.connect
>> causes it. By the way, isn't error 38 "function not supported"? What
>> does that tell us?
>>

~$ grep 38 /usr/include/asm-generic/errno.h
#define ENOSYS          38      /* Function not implemented */

# print_int (Obj.magic Unix.EINPROGRESS);;
38- : unit = ()

I.e. tagged vs plain integers

>
> It is definitely the connect(). I've put calls to
> prerr_endline() calls in each with case.

[..snip..]

>
> Any chance this is because of namespace conflict?
> What else could cause this behavior?

The first thing that caught my eye yesterday when i read the original
posting was this:

Unix.Unix_error(UNIX.EINPROGRESS,_,_)

(notice the incorrect capitalisation of module name), but i assumed
this to be a c&p mistake (which it probably is).

-- 
vale