Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: [Caml-list] Ocaml 3.06 bug
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Luc Maranget <luc.maranget@i...>
Subject: Re: [Caml-list] Ocaml 3.06 bug
> You are begging the question.
> Reading Stevens won't help much if you don't know how signals are
> handled in OCaml.
> -------------------

Well I have done similar things recently.
The Unix library provides more or less unix system calls,
so I use man 2...

In your case, if I understand well.

First, ignore SIGPIPE, we are real hackers, we look at return codes
of every IO operation (in C).

In Caml, it's something like :
Sys.set_signal Sys.sigpipe Sys.Signal_ignore 

Then, write, flush, printf etc. should normally return some error

In C, you then need to have a look at the errno variable.
In Caml this means raising some exception, namely Sys_error "message".

To get information on those error codes, you can do ``man 2 write''
for instance. The "message" string gives a readable (?) interpretation
of the error code.

Hope this helps. Apologize for any over-simplification.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: