Re: Question about Ctrl-C and less - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Question about Ctrl-C and less
Date
Msg-id 20051022101238.GB16589@svana.org
Whole thread Raw
In response to Re: Question about Ctrl-C and less  (Kevin Brown <kevin@sysexperts.com>)
List pgsql-hackers
On Fri, Oct 21, 2005 at 05:28:49PM -0700, Kevin Brown wrote:
> When a pager is being used, we check for the flag immediately after
> doing a write()/fwrite() to the pipe.  If it's set, we pclose(), clear
> the flag, and then manually invoke the non-pager signal handler.
> SIGINT should cause the write() to return immediately, possibly with
> EINTR.

You wish. PostgreSQL uses BSD signal semantics, which means system
calls get restarted. Neither read nor write will return when user
presses Ctrl-C... Hence my question about POSIX signals...

It doesn't matter though, if write blocks there's no processing
happening anyway and we can check the flag after write returns success
(pager accepted more data) or failure (pager died).

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Paresh Bafna
Date:
Subject: Nested/recursive query execution
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Nested/recursive query execution