comparison src/process.c @ 100:4be1180a9e89 r20-1b2

Import from CVS: tag r20-1b2
author cvs
date Mon, 13 Aug 2007 09:15:11 +0200
parents 6a378aca36af
children a145efe76779
comparison
equal deleted inserted replaced
99:2d83cbd90d8d 100:4be1180a9e89
671 if (socketpair (AF_UNIX, SOCK_STREAM, 0, sv) < 0) 671 if (socketpair (AF_UNIX, SOCK_STREAM, 0, sv) < 0)
672 return -1; 672 return -1;
673 *outchannel = *inchannel = sv[0]; 673 *outchannel = *inchannel = sv[0];
674 *forkout = *forkin = sv[1]; 674 *forkout = *forkin = sv[1];
675 #else /* not SKTPAIR */ 675 #else /* not SKTPAIR */
676 #ifdef WINDOWSNT
677 pipe_with_inherited_out (sv);
678 *inchannel = sv[0];
679 *forkout = sv[1];
680
681 pipe_with_inherited_in (sv);
682 *forkin = sv[0];
683 *outchannel = sv[1];
684 #else /* not WINDOWSNT */
685 int temp; 676 int temp;
686 temp = pipe (sv); 677 temp = pipe (sv);
687 if (temp < 0) return -1; 678 if (temp < 0) return -1;
688 *inchannel = sv[0]; 679 *inchannel = sv[0];
689 *forkout = sv[1]; 680 *forkout = sv[1];
690 temp = pipe (sv); 681 temp = pipe (sv);
691 if (temp < 0) return -1; 682 if (temp < 0) return -1;
692 *outchannel = sv[1]; 683 *outchannel = sv[1];
693 *forkin = sv[0]; 684 *forkin = sv[0];
694 #endif /* not WINDOWSNT */
695 #endif /* not SKTPAIR */ 685 #endif /* not SKTPAIR */
696 return 0; 686 return 0;
697 } 687 }
698 688
699 #ifndef VMS /* VMS version of this function is in vmsproc.c. */ 689 #ifndef VMS /* VMS version of this function is in vmsproc.c. */
1005 #endif /* HAVE_PTYS */ 995 #endif /* HAVE_PTYS */
1006 996
1007 signal (SIGINT, SIG_DFL); 997 signal (SIGINT, SIG_DFL);
1008 signal (SIGQUIT, SIG_DFL); 998 signal (SIGQUIT, SIG_DFL);
1009 999
1010 #ifndef MSDOS 1000 #if !defined(MSDOS) && !defined(WINDOWSNT)
1011 if (pty_flag) 1001 if (pty_flag)
1012 { 1002 {
1013 /* Set up the terminal characteristics of the pty. */ 1003 /* Set up the terminal characteristics of the pty. */
1014 child_setup_tty (xforkout); 1004 child_setup_tty (xforkout);
1015 } 1005 }
2204 reap_exited_processes (void) 2194 reap_exited_processes (void)
2205 { 2195 {
2206 int i; 2196 int i;
2207 struct Lisp_Process *p; 2197 struct Lisp_Process *p;
2208 2198
2199 #ifdef EMACS_BLOCK_SIGNAL
2209 EMACS_BLOCK_SIGNAL (SIGCHLD); 2200 EMACS_BLOCK_SIGNAL (SIGCHLD);
2201 #endif
2210 for (i = 0; i < exited_processes_index; i++) 2202 for (i = 0; i < exited_processes_index; i++)
2211 { 2203 {
2212 int pid = exited_processes[i]; 2204 int pid = exited_processes[i];
2213 WAITTYPE w = exited_processes_status[i]; 2205 WAITTYPE w = exited_processes_status[i];
2214 2206
2285 2277
2286 static void 2278 static void
2287 record_exited_processes (int block_sigchld) 2279 record_exited_processes (int block_sigchld)
2288 { 2280 {
2289 if (block_sigchld) 2281 if (block_sigchld)
2282 #ifdef EMACS_BLOCK_SIGNAL
2290 EMACS_BLOCK_SIGNAL (SIGCHLD); 2283 EMACS_BLOCK_SIGNAL (SIGCHLD);
2284 #endif
2291 2285
2292 while (sigchld_happened) 2286 while (sigchld_happened)
2293 { 2287 {
2294 int pid; 2288 int pid;
2295 WAITTYPE w; 2289 WAITTYPE w;
3021 error ("Undefined signal name %s", name); 3015 error ("Undefined signal name %s", name);
3022 } 3016 }
3023 3017
3024 #undef handle_signal 3018 #undef handle_signal
3025 3019
3026 #ifdef WINDOWSNT
3027 /* Only works for kill-type signals */
3028 return make_int (win32_kill_process (XINT (pid), XINT (sigcode)));
3029 #else
3030 return make_int (kill (XINT (pid), XINT (sigcode))); 3020 return make_int (kill (XINT (pid), XINT (sigcode)));
3031 #endif
3032 } 3021 }
3033 3022
3034 DEFUN ("process-send-eof", Fprocess_send_eof, 0, 1, 0, /* 3023 DEFUN ("process-send-eof", Fprocess_send_eof, 0, 1, 0, /*
3035 Make PROCESS see end-of-file in its input. 3024 Make PROCESS see end-of-file in its input.
3036 PROCESS may be a process, a buffer, the name of a process or buffer, or 3025 PROCESS may be a process, a buffer, the name of a process or buffer, or