comp.lang.ada
 help / color / mirror / Atom feed
From: Darren New <dnew@san.rr.com>
Subject: Re: GNAT: Setting SIGPIPE to SIG_IGN
Date: Sun, 01 Sep 2002 00:20:55 GMT
Date: 2002-09-01T00:20:55+00:00	[thread overview]
Message-ID: <3D715DBF.C8CF006A@san.rr.com> (raw)
In-Reply-To: 3D71318A.10909@cogeco.ca

"Warren W. Gay VE3WWG" wrote:
> 
> Florian Weimer wrote:
> > I want to instruct the GNAT run-time library that it sets the SIGPIPE
> > handler to SIG_IGN, so that system calls such as read() return EPIPE
> > instead of delivering a signal.
> 
> Actually, I think you mean that read(2) returns EINTR (or EAGAIN
> on some platforms). EPIPE is returned when you write to a
> pipe without a reader.

If you read from a pipe whose other end has been closed, I'm pretty sure you
always get EOF, yes? Of course, if you get a different signal while blocked
on the pipe, you of course get the same signal you'd get from any blocking
operation that gets interruped by a signal.

It's writing to a broken pipe that raises SIGPIPE, and that's only because
of the funky way that UNIX shells cause signals to be delivered to
processes. (Basically, the original V7 shells wound up having the last
process of a pipeline being the direct child, and the shell passed signals
on to it, so it died, and the other processes in the pipeline died as they
tried to write to the broken pipe. Obviated by the invention of control
terminals.)

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
   ** http://images.fbrtech.com/dnew/ **

Try our EbolaBurgers...
      So tender they melt in your mouth.



  reply	other threads:[~2002-09-01  0:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-31  9:36 GNAT: Setting SIGPIPE to SIG_IGN Florian Weimer
2002-08-31 21:13 ` Warren W. Gay VE3WWG
2002-09-01  0:20   ` Darren New [this message]
2002-09-01 10:16   ` Florian Weimer
2002-09-02  2:27     ` Warren W. Gay VE3WWG
2002-09-02 22:39       ` Florian Weimer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox