From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA18283; Tue, 1 Oct 2002 19:42:00 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA18231 for ; Tue, 1 Oct 2002 19:41:59 +0200 (MET DST) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g91Hfx508121 for ; Tue, 1 Oct 2002 19:41:59 +0200 (MET DST) Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id TAA0000016124; Tue, 1 Oct 2002 19:41:58 +0200 (MET DST) From: Luc Maranget Message-Id: <200210011741.TAA0000016124@beaune.inria.fr> Subject: Re: [Caml-list] Ocaml 3.06 bug To: olczyk@interaccess.com Date: Tue, 1 Oct 2002 19:41:58 +0200 (MET DST) Cc: caml-list@inria.fr In-Reply-To: <3d99d2ab.4138061750@smtp.interaccess.com> from "Thaddeus L. Olczyk" at oct 01, 2002 04:53:48 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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