From: cabo@informatik.uni-bremen.de (Dr. Carsten Bormann)
Cc: emacs-devel@gnu.org
Subject: Re: BLOCK_INPUT on Mac OS X
Date: Thu, 25 Nov 2004 20:13:43 +0100 [thread overview]
Message-ID: <m2sm6xn3mg.fsf@sagwa.local> (raw)
In-Reply-To: <jwvacw0c48c.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 08 Sep 2004 08:56:29 -0400")
Two millicenturies ago,
Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>> Can you try the patch below? Beware, IIRC, if emacs_read is ever
>>> called somewhere where BLOCK_INPUT is set, this could introduce
>>> other problems.
>
>> It didn't work for me on both Mac OS X and GNU/Linux. Actually,
>> `read', which has not received any data, is silently restarted after
>> processing a signal because:
>
>> 1. That's a default behavior in BSD systems. (Mac OS X)
>> 2. SA_RESTART is set in `sys_signal' if POSIX_SIGNALS is
>> defined. (GNU/Linux)
>
> Duh! I guess we'd need to unset SA_RESTART when we use SYNC_INPUT.
>
>> If SA_RESTART is not set in `sys_signal', synchronous processes can be
>> quit on GNU/Linux (with your patch). But that breaks "Emacs mostly
>> works better with restartable system services" (from a comment in
>> `sys_signal').
>
> I'm curious what this comment refers to. Anybody remembers what are the
> problems with non-restartable system services? Is it possible that those
> problems are not applicable in the case where we use SYNC_INPUT
> (i.e. when we keep signal handlers to the strict minimum)?
As you are probably aware, restartable system calls were added to BSD
to enable job control -- without restartable system calls, suspending
a process (which is mapped to a signal internally) might mean that a
write(2) was cut short and nothing in the (predominant sloppy) code
would notice. Also, most programs just weren't prepared to handle
EINTR returns from read(2). (This is from memory, about a quarter
century ago...)
I don't know how well the Emacs code checks the return values on
system calls like write. Of course, I'd assume, very very well.
So I think we should pick up the somewhat stale discussion and do
what's necessary to arrive at a stable Emacs. Why don't we just set
BROKEN_SA_RESTART with SYNC_INPUT?
Gruesse, Carsten
next prev parent reply other threads:[~2004-11-25 19:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-03 12:41 BLOCK_INPUT on Mac OS X YAMAMOTO Mitsuharu
2004-09-03 13:51 ` Kim F. Storm
2004-09-03 16:48 ` Stefan Monnier
2004-09-04 9:07 ` YAMAMOTO Mitsuharu
2004-09-06 16:17 ` Stefan
2004-09-07 8:21 ` YAMAMOTO Mitsuharu
2004-09-07 12:27 ` Stefan
2004-09-08 11:38 ` YAMAMOTO Mitsuharu
2004-09-08 12:56 ` Stefan Monnier
2004-11-25 19:13 ` Dr. Carsten Bormann [this message]
2004-11-25 19:58 ` Stefan Monnier
2004-11-26 10:09 ` YAMAMOTO Mitsuharu
2004-11-26 14:24 ` POSIX_SIGNALS (was: BLOCK_INPUT on Mac OS X) Stefan Monnier
2004-11-29 10:12 ` YAMAMOTO Mitsuharu
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2sm6xn3mg.fsf@sagwa.local \
--to=cabo@informatik.uni-bremen.de \
--cc=emacs-devel@gnu.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.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).