[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #6210] Make viewport {width, length} under direct ownership of th

From: Ben Pfaff
Subject: [patch #6210] Make viewport {width, length} under direct ownership of the user interface
Date: Tue, 25 Sep 2007 03:50:43 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20061205 Iceweasel/ (Debian-

Follow-up Comment #10, patch #6210 (project pspp):

>I can't find any documentation which says that poll will return 
>when the program receives SIGWINCH. 

It's a special case of the general principle that a system call interrupted
by a signal that has a user-specified handler will return with an EINTR error.
 (Actually, signals can be restartable, which is why I used sigaction without
specifying SA_RESTART.)

>I thought you needed ppoll.

ppoll solves a related but separate issue: the problem of atomically
unblocking a signal and waiting for its arrival.  ppoll can be approximated
with a call to sigprocmask followed by a call to poll, but there's a window
between the system calls in which the signal can be delivered, in which case
the poll will block without the caller having noticed that the signal set an
indicator variable (e.g. window_size_changed).

ppoll is Linux-only, though.  Its cousin pselect also works, but  although
pselect is in SUSv3 its support is not universal.  The traditional fallback is
to use a pipe: the signal handler writes a byte to the pipe, the poll or
select call polls the pipe for readability.  The fallback also avoids the

But I didn't think that it was worth worrying about for this case.  I have no
reason to believe that it is common for a user to resize his terminal and hit
Enter so quickly as to hit the race window ;-)


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]