#include "xgselect.h"
#endif
+#ifdef WINDOWSNT
+extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
+ EMACS_TIME *, void *);
+#endif
+
#ifndef WNOHANG
# undef waitpid
# define waitpid(pid, status, options) wait (status)
static int pty_max_bytes;
/* These setters are used only in this file, so they can be private. */
-static inline void
+static void
pset_buffer (struct Lisp_Process *p, Lisp_Object val)
{
p->buffer = val;
}
-static inline void
+static void
pset_command (struct Lisp_Process *p, Lisp_Object val)
{
p->command = val;
}
-static inline void
+static void
pset_decode_coding_system (struct Lisp_Process *p, Lisp_Object val)
{
p->decode_coding_system = val;
}
-static inline void
+static void
pset_decoding_buf (struct Lisp_Process *p, Lisp_Object val)
{
p->decoding_buf = val;
}
-static inline void
+static void
pset_encode_coding_system (struct Lisp_Process *p, Lisp_Object val)
{
p->encode_coding_system = val;
}
-static inline void
+static void
pset_encoding_buf (struct Lisp_Process *p, Lisp_Object val)
{
p->encoding_buf = val;
}
-static inline void
+static void
pset_filter (struct Lisp_Process *p, Lisp_Object val)
{
p->filter = val;
}
-static inline void
+static void
pset_log (struct Lisp_Process *p, Lisp_Object val)
{
p->log = val;
}
-static inline void
+static void
pset_mark (struct Lisp_Process *p, Lisp_Object val)
{
p->mark = val;
}
-static inline void
+static void
pset_name (struct Lisp_Process *p, Lisp_Object val)
{
p->name = val;
}
-static inline void
+static void
pset_plist (struct Lisp_Process *p, Lisp_Object val)
{
p->plist = val;
}
-static inline void
+static void
pset_sentinel (struct Lisp_Process *p, Lisp_Object val)
{
p->sentinel = val;
}
-static inline void
+static void
pset_status (struct Lisp_Process *p, Lisp_Object val)
{
p->status = val;
}
-static inline void
+static void
pset_tty_name (struct Lisp_Process *p, Lisp_Object val)
{
p->tty_name = val;
}
-static inline void
+static void
pset_type (struct Lisp_Process *p, Lisp_Object val)
{
p->type = val;
}
-static inline void
+static void
pset_write_queue (struct Lisp_Process *p, Lisp_Object val)
{
p->write_queue = val;
if (EQ (symbol, Qsignal) || EQ (symbol, Qstop))
{
- char *signame;
+ char const *signame;
synchronize_system_messages_locale ();
signame = strsignal (code);
if (signame == 0)
PTY_OPEN;
#else /* no PTY_OPEN */
{
- { /* Some systems name their pseudoterminals so that there are gaps in
- the usual sequence - for example, on HP9000/S700 systems, there
- are no pseudoterminals with names ending in 'f'. So we wait for
- three failures in a row before deciding that we've reached the
- end of the ptys. */
- int failed_count = 0;
- struct stat stb;
-
- if (stat (pty_name, &stb) < 0)
- {
- failed_count++;
- if (failed_count >= 3)
- return -1;
- }
- else
- failed_count = 0;
- }
# ifdef O_NONBLOCK
fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0);
# else
#endif
}
#else /* not HAVE_SETSID */
-#ifdef USG
- /* It's very important to call setpgrp here and no time
+ /* It's very important to call setpgid here and no time
afterwards. Otherwise, we lose our controlling tty which
is set when we open the pty. */
- setpgrp ();
-#endif /* USG */
+ setpgid (0, 0);
#endif /* not HAVE_SETSID */
#if defined (LDISC1)
if (pty_flag && xforkin >= 0)
/* In order to get a controlling terminal on some versions
of BSD, it is necessary to put the process in pgrp 0
before it opens the terminal. */
-#ifdef HAVE_SETPGID
setpgid (0, 0);
-#else
- setpgrp (0, 0);
-#endif
#endif
}
#endif /* TIOCNOTTY */
-1 meaning caller will actually read the input, so don't throw to
the quit handler, or
- DO_DISPLAY != 0 means redisplay should be done to show subprocess
+ DO_DISPLAY means redisplay should be done to show subprocess
output that arrives.
If WAIT_FOR_CELL is a cons cell, wait until its car is non-nil
int
wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
- int do_display,
+ bool do_display,
Lisp_Object wait_for_cell,
struct Lisp_Process *wait_proc, int just_wait_proc)
{
do
{
- int old_timers_run = timers_run;
+ unsigned old_timers_run = timers_run;
struct buffer *old_buffer = current_buffer;
Lisp_Object old_window = selected_window;
process_output_skip = 0;
}
#endif
+
#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS)
nfds = xg_select
#elif defined (HAVE_NS)
if (read_kbd != 0)
{
- int old_timers_run = timers_run;
+ unsigned old_timers_run = timers_run;
struct buffer *old_buffer = current_buffer;
Lisp_Object old_window = selected_window;
int leave = 0;
see full version for other parameters. We know that wait_proc will
always be NULL, since `subprocesses' isn't defined.
- DO_DISPLAY != 0 means redisplay should be done to show subprocess
+ DO_DISPLAY means redisplay should be done to show subprocess
output that arrives.
Return true if we received input from any process. */
int
wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
- int do_display,
+ bool do_display,
Lisp_Object wait_for_cell,
struct Lisp_Process *wait_proc, int just_wait_proc)
{
do
{
- int old_timers_run = timers_run;
+ unsigned old_timers_run = timers_run;
timer_delay = timer_check ();
if (timers_run != old_timers_run && do_display)
/* We must retry, since a timer may have requeued itself