From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Signal handling/zcurses
Date: Thu, 21 Apr 2011 22:52:57 -0700 [thread overview]
Message-ID: <110421225257.ZM14169@torch.brasslantern.com> (raw)
In-Reply-To: <110421200715.ZM12476@torch.brasslantern.com>
On Apr 21, 8:07pm, Bart Schaefer wrote:
}
} Interestingly, I'm able to reproduce your result with the script you
} sent -- in spite of the fact that (a) Linux normally has restartable
} system calls (b) the doc says that "Under the ncurses implementation,
} handled signals never interrupt getch" and (c) my zsh is linked with
} -lncursesw so this really should work.
This gets odder.
If you interrupt "zcurses input" with a handled signal, wget_wch() [and
I must assume wgetch()] returns ERR/EINTR. The loop in my patch then
calls it again and gets ERR/zero, which causes "zcurses input" to
return 1.
Run "zcurses input" again immediately, and it again gets ERR/zero
without ever calling read().
Run it *again* and not only does wget_wch() block waiting for input,
but now it restarts properly after a handled signal! Give it some
input so it returns success and the script-level loop in the test goes
around and wget_wch() is called a fifth time, and now it has returned
to the state where it gets interrupted by handled signals.
I was trying all this inside of GDB so I suppose that might have side-
effects, but this is damned peculiar.
next prev parent reply other threads:[~2011-04-22 5:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-20 10:19 Anthony Charles
2011-04-20 14:40 ` Bart Schaefer
2011-04-20 19:22 ` Anthony Charles
2011-04-21 8:48 ` Bart Schaefer
2011-04-21 14:31 ` Anthony Charles
2011-04-21 15:47 ` Bart Schaefer
2011-04-21 18:08 ` Anthony Charles
2011-04-22 3:07 ` Bart Schaefer
2011-04-22 5:52 ` Bart Schaefer [this message]
2011-04-22 14:22 ` Bart Schaefer
2011-04-27 8:38 ` Anthony Charles
2011-04-21 18:29 ` Anthony Charles
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=110421225257.ZM14169@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).