caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Luc Maranget <luc.maranget@inria.fr>
To: olczyk@interaccess.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Ocaml 3.06 bug
Date: Tue, 1 Oct 2002 19:41:58 +0200 (MET DST)	[thread overview]
Message-ID: <200210011741.TAA0000016124@beaune.inria.fr> (raw)
In-Reply-To: <3d99d2ab.4138061750@smtp.interaccess.com> from "Thaddeus L. Olczyk" at oct 01, 2002 04:53:48

> 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


      reply	other threads:[~2002-10-01 17:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-20 13:47 Cezary Kaliszyk
2002-10-01  9:57 ` Xavier Leroy
2002-10-01 16:53   ` Thaddeus L. Olczyk
2002-10-01 17:41     ` Luc Maranget [this message]

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=200210011741.TAA0000016124@beaune.inria.fr \
    --to=luc.maranget@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=olczyk@interaccess.com \
    /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).