Re: Question about Ctrl-C and less

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Kevin Brown <kevin(at)sysexperts(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Question about Ctrl-C and less
Date: 2005-10-22 10:12:38
Message-ID: 20051022101238.GB16589@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-10-22 10:22:54 Re: Nested/recursive query execution
Previous Message Paresh Bafna 2005-10-22 10:11:07 Nested/recursive query execution