diff options
Diffstat (limited to 'src/sysdep.c')
| -rw-r--r-- | src/sysdep.c | 137 |
1 files changed, 4 insertions, 133 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 7c7b3810956..01126c4907e 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -49,15 +49,6 @@ extern void srandom P_ ((unsigned int)); | |||
| 49 | 49 | ||
| 50 | #include "blockinput.h" | 50 | #include "blockinput.h" |
| 51 | 51 | ||
| 52 | #ifdef MAC_OS8 | ||
| 53 | #include <sys/param.h> | ||
| 54 | |||
| 55 | #ifndef subprocesses | ||
| 56 | /* Nonzero means delete a process right away if it exits (process.c). */ | ||
| 57 | static int delete_exited_processes; | ||
| 58 | #endif | ||
| 59 | #endif /* MAC_OS8 */ | ||
| 60 | |||
| 61 | #ifdef WINDOWSNT | 52 | #ifdef WINDOWSNT |
| 62 | #define read sys_read | 53 | #define read sys_read |
| 63 | #define write sys_write | 54 | #define write sys_write |
| @@ -151,12 +142,12 @@ extern int errno; | |||
| 151 | #undef TIOCSWINSZ | 142 | #undef TIOCSWINSZ |
| 152 | #endif | 143 | #endif |
| 153 | 144 | ||
| 154 | #if defined (USG) || defined (DGUX) | 145 | #if defined (USG) |
| 155 | #include <sys/utsname.h> | 146 | #include <sys/utsname.h> |
| 156 | #ifndef MEMORY_IN_STRING_H | 147 | #ifndef MEMORY_IN_STRING_H |
| 157 | #include <memory.h> | 148 | #include <memory.h> |
| 158 | #endif | 149 | #endif |
| 159 | #if defined (TIOCGWINSZ) || defined (ISC4_0) | 150 | #if defined (TIOCGWINSZ) |
| 160 | #ifdef NEED_SIOCTL | 151 | #ifdef NEED_SIOCTL |
| 161 | #include <sys/sioctl.h> | 152 | #include <sys/sioctl.h> |
| 162 | #endif | 153 | #endif |
| @@ -164,8 +155,8 @@ extern int errno; | |||
| 164 | #include <sys/stream.h> | 155 | #include <sys/stream.h> |
| 165 | #include <sys/ptem.h> | 156 | #include <sys/ptem.h> |
| 166 | #endif | 157 | #endif |
| 167 | #endif /* TIOCGWINSZ or ISC4_0 */ | 158 | #endif /* TIOCGWINSZ */ |
| 168 | #endif /* USG or DGUX */ | 159 | #endif /* USG */ |
| 169 | 160 | ||
| 170 | extern int quit_char; | 161 | extern int quit_char; |
| 171 | 162 | ||
| @@ -345,17 +336,6 @@ discard_tty_input () | |||
| 345 | &buf.main, 0, 0, terminator_mask, 0, 0); | 336 | &buf.main, 0, 0, terminator_mask, 0, 0); |
| 346 | queue_kbd_input (); | 337 | queue_kbd_input (); |
| 347 | #else /* not VMS */ | 338 | #else /* not VMS */ |
| 348 | #ifdef APOLLO | ||
| 349 | { | ||
| 350 | struct tty_display_info *tty; | ||
| 351 | for (tty = tty_list; tty; tty = tty->next) | ||
| 352 | { | ||
| 353 | int zero = 0; | ||
| 354 | if (tty->input) | ||
| 355 | ioctl (fileno (tty->input), TIOCFLUSH, &zero); | ||
| 356 | } | ||
| 357 | } | ||
| 358 | #else /* not Apollo */ | ||
| 359 | #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ | 339 | #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ |
| 360 | while (dos_keyread () != -1) | 340 | while (dos_keyread () != -1) |
| 361 | ; | 341 | ; |
| @@ -372,7 +352,6 @@ discard_tty_input () | |||
| 372 | } | 352 | } |
| 373 | } | 353 | } |
| 374 | #endif /* not MSDOS */ | 354 | #endif /* not MSDOS */ |
| 375 | #endif /* not Apollo */ | ||
| 376 | #endif /* not VMS */ | 355 | #endif /* not VMS */ |
| 377 | #endif /* not WINDOWSNT */ | 356 | #endif /* not WINDOWSNT */ |
| 378 | } | 357 | } |
| @@ -532,11 +511,6 @@ wait_for_termination (pid) | |||
| 532 | else | 511 | else |
| 533 | sigpause (SIGEMPTYMASK); | 512 | sigpause (SIGEMPTYMASK); |
| 534 | #else /* not BSD_SYSTEM, and not HPUX version >= 6 */ | 513 | #else /* not BSD_SYSTEM, and not HPUX version >= 6 */ |
| 535 | #if defined (UNIPLUS) | ||
| 536 | if (0 > kill (pid, 0)) | ||
| 537 | break; | ||
| 538 | wait (0); | ||
| 539 | #else /* neither BSD_SYSTEM nor UNIPLUS: random sysV */ | ||
| 540 | #ifdef POSIX_SIGNALS /* would this work for GNU/Linux as well? */ | 514 | #ifdef POSIX_SIGNALS /* would this work for GNU/Linux as well? */ |
| 541 | sigblock (sigmask (SIGCHLD)); | 515 | sigblock (sigmask (SIGCHLD)); |
| 542 | errno = 0; | 516 | errno = 0; |
| @@ -570,7 +544,6 @@ wait_for_termination (pid) | |||
| 570 | #endif /* not WINDOWSNT */ | 544 | #endif /* not WINDOWSNT */ |
| 571 | #endif /* not HAVE_SYSV_SIGPAUSE */ | 545 | #endif /* not HAVE_SYSV_SIGPAUSE */ |
| 572 | #endif /* not POSIX_SIGNALS */ | 546 | #endif /* not POSIX_SIGNALS */ |
| 573 | #endif /* not UNIPLUS */ | ||
| 574 | #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ | 547 | #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ |
| 575 | #endif /* not VMS */ | 548 | #endif /* not VMS */ |
| 576 | #else /* not subprocesses */ | 549 | #else /* not subprocesses */ |
| @@ -727,12 +700,6 @@ child_setup_tty (out) | |||
| 727 | if (interrupt_input) | 700 | if (interrupt_input) |
| 728 | reset_sigio (0); | 701 | reset_sigio (0); |
| 729 | #endif /* BSD4_1 */ | 702 | #endif /* BSD4_1 */ |
| 730 | #ifdef RTU | ||
| 731 | { | ||
| 732 | int zero = 0; | ||
| 733 | ioctl (out, FIOASYNC, &zero); | ||
| 734 | } | ||
| 735 | #endif /* RTU */ | ||
| 736 | #endif /* not DOS_NT */ | 703 | #endif /* not DOS_NT */ |
| 737 | } | 704 | } |
| 738 | #endif /* not VMS */ | 705 | #endif /* not VMS */ |
| @@ -821,7 +788,6 @@ sys_suspend () | |||
| 821 | 788 | ||
| 822 | /* Fork a subshell. */ | 789 | /* Fork a subshell. */ |
| 823 | 790 | ||
| 824 | #ifndef MAC_OS8 | ||
| 825 | void | 791 | void |
| 826 | sys_subshell () | 792 | sys_subshell () |
| 827 | { | 793 | { |
| @@ -957,7 +923,6 @@ sys_subshell () | |||
| 957 | synch_process_alive = 0; | 923 | synch_process_alive = 0; |
| 958 | #endif /* !VMS */ | 924 | #endif /* !VMS */ |
| 959 | } | 925 | } |
| 960 | #endif /* !MAC_OS8 */ | ||
| 961 | 926 | ||
| 962 | static void | 927 | static void |
| 963 | save_signal_handlers (saved_handlers) | 928 | save_signal_handlers (saved_handlers) |
| @@ -1066,69 +1031,6 @@ unrequest_sigio (void) | |||
| 1066 | } | 1031 | } |
| 1067 | 1032 | ||
| 1068 | #else /* no FASYNC */ | 1033 | #else /* no FASYNC */ |
| 1069 | #ifdef STRIDE /* Stride doesn't have FASYNC - use FIOASYNC */ | ||
| 1070 | |||
| 1071 | void | ||
| 1072 | request_sigio () | ||
| 1073 | { | ||
| 1074 | int on = 1; | ||
| 1075 | |||
| 1076 | if (noninteractive || read_socket_hook) | ||
| 1077 | return; | ||
| 1078 | |||
| 1079 | /* XXX CURTTY() is bogus here. */ | ||
| 1080 | ioctl (fileno (CURTTY ()->input), FIOASYNC, &on); | ||
| 1081 | interrupts_deferred = 0; | ||
| 1082 | } | ||
| 1083 | |||
| 1084 | void | ||
| 1085 | unrequest_sigio () | ||
| 1086 | { | ||
| 1087 | int off = 0; | ||
| 1088 | |||
| 1089 | if (noninteractive || read_socket_hook) | ||
| 1090 | return; | ||
| 1091 | |||
| 1092 | /* XXX CURTTY() is bogus here. */ | ||
| 1093 | ioctl (fileno (CURTTY ()->input), FIOASYNC, &off); | ||
| 1094 | interrupts_deferred = 1; | ||
| 1095 | } | ||
| 1096 | |||
| 1097 | #else /* not FASYNC, not STRIDE */ | ||
| 1098 | |||
| 1099 | #ifdef _CX_UX | ||
| 1100 | |||
| 1101 | #include <termios.h> | ||
| 1102 | |||
| 1103 | void | ||
| 1104 | request_sigio () | ||
| 1105 | { | ||
| 1106 | int on = 1; | ||
| 1107 | sigset_t st; | ||
| 1108 | |||
| 1109 | if (noninteractive || read_socket_hook) | ||
| 1110 | return; | ||
| 1111 | |||
| 1112 | sigemptyset (&st); | ||
| 1113 | sigaddset (&st, SIGIO); | ||
| 1114 | ioctl (0, FIOASYNC, &on); /* XXX This fails for multiple ttys. */ | ||
| 1115 | interrupts_deferred = 0; | ||
| 1116 | sigprocmask (SIG_UNBLOCK, &st, (sigset_t *)0); | ||
| 1117 | } | ||
| 1118 | |||
| 1119 | void | ||
| 1120 | unrequest_sigio () | ||
| 1121 | { | ||
| 1122 | int off = 0; | ||
| 1123 | |||
| 1124 | if (noninteractive || read_socket_hook) | ||
| 1125 | return; | ||
| 1126 | |||
| 1127 | ioctl (0, FIOASYNC, &off); /* XXX This fails for multiple ttys. */ | ||
| 1128 | interrupts_deferred = 1; | ||
| 1129 | } | ||
| 1130 | |||
| 1131 | #else /* ! _CX_UX */ | ||
| 1132 | #ifndef MSDOS | 1034 | #ifndef MSDOS |
| 1133 | 1035 | ||
| 1134 | void | 1036 | void |
| @@ -1150,8 +1052,6 @@ unrequest_sigio () | |||
| 1150 | } | 1052 | } |
| 1151 | 1053 | ||
| 1152 | #endif /* MSDOS */ | 1054 | #endif /* MSDOS */ |
| 1153 | #endif /* _CX_UX */ | ||
| 1154 | #endif /* STRIDE */ | ||
| 1155 | #endif /* FASYNC */ | 1055 | #endif /* FASYNC */ |
| 1156 | #endif /* F_SETFL */ | 1056 | #endif /* F_SETFL */ |
| 1157 | #endif /* SIGIO */ | 1057 | #endif /* SIGIO */ |
| @@ -1486,10 +1386,6 @@ init_sys_modes (tty_out) | |||
| 1486 | #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) | 1386 | #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) |
| 1487 | XSETINT (Vtty_erase_char, tty.main.c_cc[VERASE]); | 1387 | XSETINT (Vtty_erase_char, tty.main.c_cc[VERASE]); |
| 1488 | 1388 | ||
| 1489 | #ifdef DGUX | ||
| 1490 | /* This allows meta to be sent on 8th bit. */ | ||
| 1491 | tty.main.c_iflag &= ~INPCK; /* don't check input for parity */ | ||
| 1492 | #endif | ||
| 1493 | tty.main.c_iflag |= (IGNBRK); /* Ignore break condition */ | 1389 | tty.main.c_iflag |= (IGNBRK); /* Ignore break condition */ |
| 1494 | tty.main.c_iflag &= ~ICRNL; /* Disable map of CR to NL on input */ | 1390 | tty.main.c_iflag &= ~ICRNL; /* Disable map of CR to NL on input */ |
| 1495 | #ifdef INLCR /* I'm just being cautious, | 1391 | #ifdef INLCR /* I'm just being cautious, |
| @@ -1703,11 +1599,9 @@ init_sys_modes (tty_out) | |||
| 1703 | #ifdef TCXONC | 1599 | #ifdef TCXONC |
| 1704 | if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TCXONC, 1); | 1600 | if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TCXONC, 1); |
| 1705 | #endif | 1601 | #endif |
| 1706 | #ifndef APOLLO | ||
| 1707 | #ifdef TIOCSTART | 1602 | #ifdef TIOCSTART |
| 1708 | if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0); | 1603 | if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0); |
| 1709 | #endif | 1604 | #endif |
| 1710 | #endif | ||
| 1711 | 1605 | ||
| 1712 | #if defined (HAVE_TERMIOS) || defined (HPUX9) | 1606 | #if defined (HAVE_TERMIOS) || defined (HPUX9) |
| 1713 | #ifdef TCOON | 1607 | #ifdef TCOON |
| @@ -2085,14 +1979,6 @@ setup_pty (fd) | |||
| 2085 | } | 1979 | } |
| 2086 | #endif | 1980 | #endif |
| 2087 | #endif | 1981 | #endif |
| 2088 | #ifdef IBMRTAIX | ||
| 2089 | /* On AIX, the parent gets SIGHUP when a pty attached child dies. So, we */ | ||
| 2090 | /* ignore SIGHUP once we've started a child on a pty. Note that this may */ | ||
| 2091 | /* cause EMACS not to die when it should, i.e., when its own controlling */ | ||
| 2092 | /* tty goes away. I've complained to the AIX developers, and they may */ | ||
| 2093 | /* change this behavior, but I'm not going to hold my breath. */ | ||
| 2094 | signal (SIGHUP, SIG_IGN); | ||
| 2095 | #endif | ||
| 2096 | } | 1982 | } |
| 2097 | #endif /* HAVE_PTYS */ | 1983 | #endif /* HAVE_PTYS */ |
| 2098 | 1984 | ||
| @@ -2377,13 +2263,8 @@ start_of_text () | |||
| 2377 | #ifdef TEXT_START | 2263 | #ifdef TEXT_START |
| 2378 | return ((char *) TEXT_START); | 2264 | return ((char *) TEXT_START); |
| 2379 | #else | 2265 | #else |
| 2380 | #ifdef GOULD | ||
| 2381 | extern csrt (); | ||
| 2382 | return ((char *) csrt); | ||
| 2383 | #else /* not GOULD */ | ||
| 2384 | extern int _start (); | 2266 | extern int _start (); |
| 2385 | return ((char *) _start); | 2267 | return ((char *) _start); |
| 2386 | #endif /* GOULD */ | ||
| 2387 | #endif /* TEXT_START */ | 2268 | #endif /* TEXT_START */ |
| 2388 | } | 2269 | } |
| 2389 | #endif /* not HAVE_TEXT_START */ | 2270 | #endif /* not HAVE_TEXT_START */ |
| @@ -3324,16 +3205,6 @@ get_random () | |||
| 3324 | return val & ((1L << VALBITS) - 1); | 3205 | return val & ((1L << VALBITS) - 1); |
| 3325 | } | 3206 | } |
| 3326 | 3207 | ||
| 3327 | #ifdef WRONG_NAME_INSQUE | ||
| 3328 | |||
| 3329 | insque (q,p) | ||
| 3330 | caddr_t q,p; | ||
| 3331 | { | ||
| 3332 | _insque (q,p); | ||
| 3333 | } | ||
| 3334 | |||
| 3335 | #endif | ||
| 3336 | |||
| 3337 | #ifdef VMS | 3208 | #ifdef VMS |
| 3338 | 3209 | ||
| 3339 | #ifdef getenv | 3210 | #ifdef getenv |