/* Interfaces to system-dependent kernel and library entries.
- Copyright (C) 1985, 86,87,88,93,94,95,1999,2000,01,2003
- Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001,
+ 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
if (pid == -1)
write (1, "Can't execute subshell", 22);
#else /* not WINDOWSNT */
- execlp (sh, sh, 0);
+ execlp (sh, sh, (char *) 0);
write (1, "Can't execute subshell", 22);
_exit (1);
#endif /* not WINDOWSNT */
#else
#ifdef VMS
+ /* Use a fresh channel since the current one may have stale info
+ (for example, from prior to a suspend); and to avoid a dependency
+ in the init sequence. */
+ int chan;
struct sensemode tty;
- SYS$QIOW (0, input_fd, IO$_SENSEMODE, &tty, 0, 0,
- &tty.class, 12, 0, 0, 0, 0);
+ SYS$ASSIGN (&input_dsc, &chan, 0, 0);
+ SYS$QIOW (0, chan, IO$_SENSEMODE, &tty, 0, 0,
+ &tty.class, 12, 0, 0, 0, 0);
+ SYS$DASSGN (chan);
*widthp = tty.scr_wid;
*heightp = tty.scr_len;
#else /* not BSD4_1 */
signal (SIGALRM, SIG_IGN);
#endif /* not BSD4_1 */
+ SIGNAL_THREAD_CHECK (SIGALRM);
if (read_alarm_should_throw)
longjmp (read_alarm_throw, 1);
}
struct sigaction new_action, old_action;
sigemptyset (&new_action.sa_mask);
new_action.sa_handler = action;
-#if defined (SA_RESTART) && ! defined (BROKEN_SA_RESTART)
+#if defined (SA_RESTART) && ! defined (BROKEN_SA_RESTART) && !defined(SYNC_INPUT)
/* Emacs mostly works better with restartable system services. If this
flag exists, we probably want to turn it on here.
However, on some systems this resets the timeout of `select'
which means that `select' never finishes if it keeps getting signals.
BROKEN_SA_RESTART is defined on those systems. */
+ /* It's not clear why the comment above says "mostly works better". --Stef
+ When SYNC_INPUT is set, we don't want SA_RESTART because we need to poll
+ for pending input so we need long-running syscalls to be interrupted
+ after a signal that sets the interrupt_input_pending flag. */
new_action.sa_flags = SA_RESTART;
#else
new_action.sa_flags = 0;
#endif
while ((rtnval = open (path, oflag, mode)) == -1
- && (errno == EINTR));
+ && (errno == EINTR))
+ QUIT;
return (rtnval);
}
register int rtnval;
while ((rtnval = read (fildes, buf, nbyte)) == -1
- && (errno == EINTR));
+ && (errno == EINTR))
+ QUIT;
return (rtnval);
}
if (rtnval == -1)
{
if (errno == EINTR)
- continue;
+ {
+#ifdef SYNC_INPUT
+ /* I originally used `QUIT' but that might causes files to
+ be truncated if you hit C-g in the middle of it. --Stef */
+ if (interrupt_input_pending)
+ handle_async_input ();
+#endif
+ continue;
+ }
else
return (bytes_written ? bytes_written : -1);
}
\f
/* Functions for VMS */
#ifdef VMS
-#include "vms-pwd.h"
#include <acldef.h>
#include <chpdef.h>
#include <jpidef.h>