Mercurial > emacs
comparison src/process.c @ 87730:91da483b3fa5
* movemail.c:
* make-docfile.c: Remove reference to symbols defined by systems
not supported anymore: MAC_OS8, XENIX and STRIDE.
* (src/m/mips.h):
* (src/m/intel386.h):
* callproc.c:
* config.in:
* ecrt0.c:
* emacs.c:
* fileio.c:
* frame.c:
* getpagesize.h:
* keyboard.c:
* lread.c:
* process.c:
* puresize.h:
* sysdep.c:
* systty.h:
* syswait.h:
* unexec.c:
* xdisp.c:
* alloc.c: Remove code containing references to symbols defined by
unsupported systems.
| author | Dan Nicolaescu <dann@ics.uci.edu> |
|---|---|
| date | Sun, 13 Jan 2008 00:43:55 +0000 |
| parents | f0dfa6a512bb |
| children | 8f7e97005eef |
comparison
equal
deleted
inserted
replaced
| 87729:47fbf21cf3d3 | 87730:91da483b3fa5 |
|---|---|
| 76 /* TERM is a poor-man's SLIP, used on GNU/Linux. */ | 76 /* TERM is a poor-man's SLIP, used on GNU/Linux. */ |
| 77 #ifdef TERM | 77 #ifdef TERM |
| 78 #include <client.h> | 78 #include <client.h> |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */ | 81 /* On some systems, inet_addr returns a 'struct in_addr'. */ |
| 82 #ifdef HAVE_BROKEN_INET_ADDR | 82 #ifdef HAVE_BROKEN_INET_ADDR |
| 83 #define IN_ADDR struct in_addr | 83 #define IN_ADDR struct in_addr |
| 84 #define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1) | 84 #define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1) |
| 85 #else | 85 #else |
| 86 #define IN_ADDR unsigned long | 86 #define IN_ADDR unsigned long |
| 87 #define NUMERIC_ADDR_ERROR (numeric_addr == -1) | 87 #define NUMERIC_ADDR_ERROR (numeric_addr == -1) |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 #if defined(BSD_SYSTEM) || defined(STRIDE) | 90 #if defined(BSD_SYSTEM) |
| 91 #include <sys/ioctl.h> | 91 #include <sys/ioctl.h> |
| 92 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) | 92 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) |
| 93 #include <fcntl.h> | 93 #include <fcntl.h> |
| 94 #endif /* HAVE_PTYS and no O_NDELAY */ | 94 #endif /* HAVE_PTYS and no O_NDELAY */ |
| 95 #endif /* BSD_SYSTEM || STRIDE */ | 95 #endif /* BSD_SYSTEM */ |
| 96 | 96 |
| 97 #ifdef BROKEN_O_NONBLOCK | 97 #ifdef BROKEN_O_NONBLOCK |
| 98 #undef O_NONBLOCK | 98 #undef O_NONBLOCK |
| 99 #endif /* BROKEN_O_NONBLOCK */ | 99 #endif /* BROKEN_O_NONBLOCK */ |
| 100 | 100 |
| 594 #ifdef PTY_TTY_NAME_SPRINTF | 594 #ifdef PTY_TTY_NAME_SPRINTF |
| 595 PTY_TTY_NAME_SPRINTF | 595 PTY_TTY_NAME_SPRINTF |
| 596 #else | 596 #else |
| 597 sprintf (pty_name, "/dev/tty%c%x", c, i); | 597 sprintf (pty_name, "/dev/tty%c%x", c, i); |
| 598 #endif /* no PTY_TTY_NAME_SPRINTF */ | 598 #endif /* no PTY_TTY_NAME_SPRINTF */ |
| 599 #ifndef UNIPLUS | |
| 600 if (access (pty_name, 6) != 0) | 599 if (access (pty_name, 6) != 0) |
| 601 { | 600 { |
| 602 emacs_close (fd); | 601 emacs_close (fd); |
| 603 # if !defined(IRIS) && !defined(__sgi) | 602 # if !defined(IRIS) && !defined(__sgi) |
| 604 continue; | 603 continue; |
| 605 # else | 604 # else |
| 606 return -1; | 605 return -1; |
| 607 # endif /* IRIS */ | 606 # endif /* IRIS */ |
| 608 } | 607 } |
| 609 #endif /* not UNIPLUS */ | |
| 610 setup_pty (fd); | 608 setup_pty (fd); |
| 611 return fd; | 609 return fd; |
| 612 } | 610 } |
| 613 } | 611 } |
| 614 return -1; | 612 return -1; |
| 1887 #else | 1885 #else |
| 1888 forkout = forkin = emacs_open (pty_name, O_RDWR, 0); | 1886 forkout = forkin = emacs_open (pty_name, O_RDWR, 0); |
| 1889 #endif | 1887 #endif |
| 1890 if (forkin < 0) | 1888 if (forkin < 0) |
| 1891 report_file_error ("Opening pty", Qnil); | 1889 report_file_error ("Opening pty", Qnil); |
| 1892 #if defined (RTU) || defined (UNIPLUS) || defined (DONT_REOPEN_PTY) | 1890 #if defined (DONT_REOPEN_PTY) |
| 1893 /* In the case that vfork is defined as fork, the parent process | 1891 /* In the case that vfork is defined as fork, the parent process |
| 1894 (Emacs) may send some data before the child process completes | 1892 (Emacs) may send some data before the child process completes |
| 1895 tty options setup. So we setup tty before forking. */ | 1893 tty options setup. So we setup tty before forking. */ |
| 1896 child_setup_tty (forkout); | 1894 child_setup_tty (forkout); |
| 1897 #endif /* RTU or UNIPLUS or DONT_REOPEN_PTY */ | 1895 #endif /* DONT_REOPEN_PTY */ |
| 1898 #else | 1896 #else |
| 1899 forkin = forkout = -1; | 1897 forkin = forkout = -1; |
| 1900 #endif /* not USG, or USG_SUBTTY_WORKS */ | 1898 #endif /* not USG, or USG_SUBTTY_WORKS */ |
| 1901 pty_flag = 1; | 1899 pty_flag = 1; |
| 1902 } | 1900 } |
| 1931 | 1929 |
| 1932 #if 0 | 1930 #if 0 |
| 1933 /* Replaced by close_process_descs */ | 1931 /* Replaced by close_process_descs */ |
| 1934 set_exclusive_use (inchannel); | 1932 set_exclusive_use (inchannel); |
| 1935 set_exclusive_use (outchannel); | 1933 set_exclusive_use (outchannel); |
| 1936 #endif | |
| 1937 | |
| 1938 /* Stride people say it's a mystery why this is needed | |
| 1939 as well as the O_NDELAY, but that it fails without this. */ | |
| 1940 #if defined (STRIDE) || (defined (pfa) && defined (HAVE_PTYS)) | |
| 1941 { | |
| 1942 int one = 1; | |
| 1943 ioctl (inchannel, FIONBIO, &one); | |
| 1944 } | |
| 1945 #endif | 1934 #endif |
| 1946 | 1935 |
| 1947 #ifdef O_NONBLOCK | 1936 #ifdef O_NONBLOCK |
| 1948 fcntl (inchannel, F_SETFL, O_NONBLOCK); | 1937 fcntl (inchannel, F_SETFL, O_NONBLOCK); |
| 1949 fcntl (outchannel, F_SETFL, O_NONBLOCK); | 1938 fcntl (outchannel, F_SETFL, O_NONBLOCK); |
| 1991 #else /* !POSIX_SIGNALS */ | 1980 #else /* !POSIX_SIGNALS */ |
| 1992 #ifdef SIGCHLD | 1981 #ifdef SIGCHLD |
| 1993 #ifdef BSD4_1 | 1982 #ifdef BSD4_1 |
| 1994 sighold (SIGCHLD); | 1983 sighold (SIGCHLD); |
| 1995 #else /* not BSD4_1 */ | 1984 #else /* not BSD4_1 */ |
| 1996 #if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX) | 1985 #if defined (BSD_SYSTEM) || defined (HPUX) |
| 1997 sigsetmask (sigmask (SIGCHLD)); | 1986 sigsetmask (sigmask (SIGCHLD)); |
| 1998 #else /* ordinary USG */ | 1987 #else /* ordinary USG */ |
| 1999 #if 0 | 1988 #if 0 |
| 2000 sigchld_deferred = 0; | 1989 sigchld_deferred = 0; |
| 2001 sigchld = signal (SIGCHLD, create_process_sigchld); | 1990 sigchld = signal (SIGCHLD, create_process_sigchld); |
| 2105 #endif | 2094 #endif |
| 2106 #endif | 2095 #endif |
| 2107 } | 2096 } |
| 2108 #endif /* TIOCNOTTY */ | 2097 #endif /* TIOCNOTTY */ |
| 2109 | 2098 |
| 2110 #if !defined (RTU) && !defined (UNIPLUS) && !defined (DONT_REOPEN_PTY) | 2099 #if !defined (DONT_REOPEN_PTY) |
| 2111 /*** There is a suggestion that this ought to be a | 2100 /*** There is a suggestion that this ought to be a |
| 2112 conditional on TIOCSPGRP, | 2101 conditional on TIOCSPGRP, |
| 2113 or !(defined (HAVE_SETSID) && defined (TIOCSCTTY)). | 2102 or !(defined (HAVE_SETSID) && defined (TIOCSCTTY)). |
| 2114 Trying the latter gave the wrong results on Debian GNU/Linux 1.1; | 2103 Trying the latter gave the wrong results on Debian GNU/Linux 1.1; |
| 2115 that system does seem to need this code, even though | 2104 that system does seem to need this code, even though |
| 2139 #ifdef SET_CHILD_PTY_PGRP | 2128 #ifdef SET_CHILD_PTY_PGRP |
| 2140 ioctl (xforkin, TIOCSPGRP, &pgrp); | 2129 ioctl (xforkin, TIOCSPGRP, &pgrp); |
| 2141 ioctl (xforkout, TIOCSPGRP, &pgrp); | 2130 ioctl (xforkout, TIOCSPGRP, &pgrp); |
| 2142 #endif | 2131 #endif |
| 2143 } | 2132 } |
| 2144 #endif /* not UNIPLUS and not RTU and not DONT_REOPEN_PTY */ | 2133 #endif /* not DONT_REOPEN_PTY */ |
| 2145 | 2134 |
| 2146 #ifdef SETUP_SLAVE_PTY | 2135 #ifdef SETUP_SLAVE_PTY |
| 2147 if (pty_flag) | 2136 if (pty_flag) |
| 2148 { | 2137 { |
| 2149 SETUP_SLAVE_PTY; | 2138 SETUP_SLAVE_PTY; |
| 2166 #else /* !POSIX_SIGNALS */ | 2155 #else /* !POSIX_SIGNALS */ |
| 2167 #ifdef SIGCHLD | 2156 #ifdef SIGCHLD |
| 2168 #ifdef BSD4_1 | 2157 #ifdef BSD4_1 |
| 2169 sigrelse (SIGCHLD); | 2158 sigrelse (SIGCHLD); |
| 2170 #else /* not BSD4_1 */ | 2159 #else /* not BSD4_1 */ |
| 2171 #if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX) | 2160 #if defined (BSD_SYSTEM) || defined (HPUX) |
| 2172 sigsetmask (SIGEMPTYMASK); | 2161 sigsetmask (SIGEMPTYMASK); |
| 2173 #else /* ordinary USG */ | 2162 #else /* ordinary USG */ |
| 2174 #if 0 | 2163 #if 0 |
| 2175 signal (SIGCHLD, sigchld); | 2164 signal (SIGCHLD, sigchld); |
| 2176 #endif | 2165 #endif |
| 2177 #endif /* ordinary USG */ | 2166 #endif /* ordinary USG */ |
| 2178 #endif /* not BSD4_1 */ | 2167 #endif /* not BSD4_1 */ |
| 2179 #endif /* SIGCHLD */ | 2168 #endif /* SIGCHLD */ |
| 2180 #endif /* !POSIX_SIGNALS */ | 2169 #endif /* !POSIX_SIGNALS */ |
| 2181 | 2170 |
| 2182 #if !defined (RTU) && !defined (UNIPLUS) && !defined (DONT_REOPEN_PTY) | 2171 #if !defined (DONT_REOPEN_PTY) |
| 2183 if (pty_flag) | 2172 if (pty_flag) |
| 2184 child_setup_tty (xforkout); | 2173 child_setup_tty (xforkout); |
| 2185 #endif /* not RTU and not UNIPLUS and not DONT_REOPEN_PTY */ | 2174 #endif /* not DONT_REOPEN_PTY */ |
| 2186 #ifdef WINDOWSNT | 2175 #ifdef WINDOWSNT |
| 2187 pid = child_setup (xforkin, xforkout, xforkout, | 2176 pid = child_setup (xforkin, xforkout, xforkout, |
| 2188 new_argv, 1, current_dir); | 2177 new_argv, 1, current_dir); |
| 2189 #else /* not WINDOWSNT */ | 2178 #else /* not WINDOWSNT */ |
| 2190 child_setup (xforkin, xforkout, xforkout, | 2179 child_setup (xforkin, xforkout, xforkout, |
| 2258 #else /* !POSIX_SIGNALS */ | 2247 #else /* !POSIX_SIGNALS */ |
| 2259 #ifdef SIGCHLD | 2248 #ifdef SIGCHLD |
| 2260 #ifdef BSD4_1 | 2249 #ifdef BSD4_1 |
| 2261 sigrelse (SIGCHLD); | 2250 sigrelse (SIGCHLD); |
| 2262 #else /* not BSD4_1 */ | 2251 #else /* not BSD4_1 */ |
| 2263 #if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX) | 2252 #if defined (BSD_SYSTEM) || defined (HPUX) |
| 2264 sigsetmask (SIGEMPTYMASK); | 2253 sigsetmask (SIGEMPTYMASK); |
| 2265 #else /* ordinary USG */ | 2254 #else /* ordinary USG */ |
| 2266 #if 0 | 2255 #if 0 |
| 2267 signal (SIGCHLD, sigchld); | 2256 signal (SIGCHLD, sigchld); |
| 2268 /* Now really handle any of these signals | 2257 /* Now really handle any of these signals |
| 4647 interrupted. Treat it just like EINTR. Bleah. Note | 4636 interrupted. Treat it just like EINTR. Bleah. Note |
| 4648 that we want to test for the "ultrix" CPP symbol, not | 4637 that we want to test for the "ultrix" CPP symbol, not |
| 4649 "__ultrix__"; the latter is only defined under GCC, but | 4638 "__ultrix__"; the latter is only defined under GCC, but |
| 4650 not by DEC's bundled CC. -JimB */ | 4639 not by DEC's bundled CC. -JimB */ |
| 4651 else if (xerrno == ENOMEM) | 4640 else if (xerrno == ENOMEM) |
| 4652 no_avail = 1; | |
| 4653 #endif | |
| 4654 #ifdef ALLIANT | |
| 4655 /* This happens for no known reason on ALLIANT. | |
| 4656 I am guessing that this is the right response. -- RMS. */ | |
| 4657 else if (xerrno == EFAULT) | |
| 4658 no_avail = 1; | 4641 no_avail = 1; |
| 4659 #endif | 4642 #endif |
| 4660 else if (xerrno == EBADF) | 4643 else if (xerrno == EBADF) |
| 4661 { | 4644 { |
| 4662 #ifdef AIX | 4645 #ifdef AIX |
