Browse thread
Re: [Caml-list] Ocaml 3.06 bug
- Luc Maranget
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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 code. 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. --Luc ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners