Mercurial > emacs
comparison src/sysdep.c @ 96303:ddedcecb18ef
* unexnext.c:
* m/ews4800.h:
* m/hp9000s300.h:
* m/ibm370aix.h:
* m/mips-siemens.h:
* m/ncr386.h:
* m/next.h:
* m/pmax.h:
* m/powerpcle.h:
* m/tandem-s2.h:
* s/386bsd.h:
* s/bsd386.h:
* s/bsd4-1.h:
* s/bsd4-2.h:
* s/bsdos2-1.h:
* s/bsdos2.h:
* s/bsdos3.h:
* s/bsdos4.h:
* s/nextstep.h:
* s/ultrix4-3.h:
* s/usg5-0.h:
* s/usg5-2-2.h:
* s/usg5-2.h:
* s/usg5-4-3.h:
* s/ux4800.h:
* s/uxpds.h:
* s/uxpv.h: Remove support for obsolete systems.
* s/hpux.h, s/hpux10.h, s/hpux8.h, s/hpux9.h, s/hpux9shr.h:
Remove, insert contents in s/hpux-10.20.h
* s/aix3-1.h, s/aix3-2-5.h, s/aix3-2.h, s/aix4-1.h, s/aix4.h:
Remove, insert contents in s/aix-4.2.h
* s/usg5-3.h: Remove, insert contents in s/usg5-4.h.
* s/bsd4-3.h: Rename to ..
* s/bsd-common.h: ... this.
* src/data.c:
* src/doc.c:
* src/ecrt0.c:
* src/emacs.c:
* src/fileio.c:
* src/floatfns.c:
* src/keyboard.c:
* src/mem-limits.h:
* src/print.c:
* src/process.c:
* src/sysdep.c:
* src/syssignal.h:
* src/systty.h:
* src/syswait.h:
* src/term.c:
* src/unexec.c:
* src/unexelf.c:
* src/unexhp9k800.c:
* src/m/hp800.h:
* src/m/ibmrs6000.h:
* src/m/mips.h:
* src/m/vax.h:
* src/s/darwin.h:
* src/s/freebsd.h:
* src/s/gnu.h:
* src/s/ms-w32.h:
* src/s/msdos.h:
* src/s/netbsd.h:
* src/s/template.h: Remove references to obsolete variables.
* Makefile.in: Add dependencies for all unexec files.
(admindir): Remove unused variable.
(UNEXEC_SRC): Remove references.
* config.nt: Remove reference to UNEXEC_SRC.
* lwlib.c: Remove references to obsolete variables.
* fakemail.c: Remove references to obsolete variables.
* os.texi: Remove references to obsolete systems.
* configure.in:
* configure: Remove references to obsolete systems.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Thu, 26 Jun 2008 04:24:54 +0000 |
parents | eb403674cfbf |
children | 7d463685c286 |
comparison
equal
deleted
inserted
replaced
96302:b3db7e68c460 | 96303:ddedcecb18ef |
---|---|
204 /* LPASS8 is new in 4.3, and makes cbreak mode provide all 8 bits. */ | 204 /* LPASS8 is new in 4.3, and makes cbreak mode provide all 8 bits. */ |
205 #ifndef LPASS8 | 205 #ifndef LPASS8 |
206 #define LPASS8 0 | 206 #define LPASS8 0 |
207 #endif | 207 #endif |
208 | 208 |
209 #ifdef BSD4_1 | |
210 #define LNOFLSH 0100000 | |
211 #endif | |
212 | |
213 static int baud_convert[] = | 209 static int baud_convert[] = |
214 #ifdef BAUD_CONVERT | 210 #ifdef BAUD_CONVERT |
215 BAUD_CONVERT; | 211 BAUD_CONVERT; |
216 #else | 212 #else |
217 { | 213 { |
232 #endif | 228 #endif |
233 | 229 |
234 int emacs_ospeed; | 230 int emacs_ospeed; |
235 | 231 |
236 void croak P_ ((char *)) NO_RETURN; | 232 void croak P_ ((char *)) NO_RETURN; |
237 | |
238 #ifdef AIXHFT | |
239 void hft_init P_ ((struct tty_display_info *)); | |
240 void hft_reset P_ ((struct tty_display_info *)); | |
241 #endif | |
242 | 233 |
243 /* Temporary used by `sigblock' when defined in terms of signprocmask. */ | 234 /* Temporary used by `sigblock' when defined in terms of signprocmask. */ |
244 | 235 |
245 SIGMASKTYPE sigprocmask_set; | 236 SIGMASKTYPE sigprocmask_set; |
246 | 237 |
481 int status; | 472 int status; |
482 | 473 |
483 status = SYS$FORCEX (&pid, 0, 0); | 474 status = SYS$FORCEX (&pid, 0, 0); |
484 break; | 475 break; |
485 #else /* not VMS */ | 476 #else /* not VMS */ |
486 #if defined (BSD_SYSTEM) || (defined (HPUX) && !defined (HPUX_5)) | 477 #if defined (BSD_SYSTEM) || defined (HPUX) |
487 /* Note that kill returns -1 even if the process is just a zombie now. | 478 /* Note that kill returns -1 even if the process is just a zombie now. |
488 But inevitably a SIGCHLD interrupt should be generated | 479 But inevitably a SIGCHLD interrupt should be generated |
489 and child_sig will do wait3 and make the process go away. */ | 480 and child_sig will do wait3 and make the process go away. */ |
490 /* There is some indication that there is a bug involved with | 481 /* There is some indication that there is a bug involved with |
491 termination of subprocesses, perhaps involving a kernel bug too, | 482 termination of subprocesses, perhaps involving a kernel bug too, |
540 #endif /* not VMS */ | 531 #endif /* not VMS */ |
541 #else /* not subprocesses */ | 532 #else /* not subprocesses */ |
542 #if __DJGPP__ > 1 | 533 #if __DJGPP__ > 1 |
543 break; | 534 break; |
544 #else /* not __DJGPP__ > 1 */ | 535 #else /* not __DJGPP__ > 1 */ |
545 #ifndef BSD4_1 | |
546 if (kill (pid, 0) < 0) | 536 if (kill (pid, 0) < 0) |
547 break; | 537 break; |
548 wait (0); | 538 wait (0); |
549 #else /* BSD4_1 */ | |
550 int status; | |
551 status = wait (0); | |
552 if (status == pid || status == -1) | |
553 break; | |
554 #endif /* BSD4_1 */ | |
555 #endif /* not __DJGPP__ > 1*/ | 539 #endif /* not __DJGPP__ > 1*/ |
556 #endif /* not subprocesses */ | 540 #endif /* not subprocesses */ |
557 } | 541 } |
558 } | 542 } |
559 | 543 |
693 | 677 |
694 #endif /* not HAVE_TERMIO */ | 678 #endif /* not HAVE_TERMIO */ |
695 | 679 |
696 EMACS_SET_TTY (out, &s, 0); | 680 EMACS_SET_TTY (out, &s, 0); |
697 | 681 |
698 #ifdef BSD4_1 | |
699 if (interrupt_input) | |
700 reset_sigio (0); | |
701 #endif /* BSD4_1 */ | |
702 #endif /* not DOS_NT */ | 682 #endif /* not DOS_NT */ |
703 } | 683 } |
704 #endif /* not VMS */ | 684 #endif /* not VMS */ |
705 | 685 |
706 #endif /* subprocesses */ | 686 #endif /* subprocesses */ |
1265 return 0; | 1245 return 0; |
1266 } | 1246 } |
1267 | 1247 |
1268 | 1248 |
1269 | 1249 |
1270 #ifdef BSD4_1 | |
1271 /* BSD 4.1 needs to keep track of the lmode bits in order to start | |
1272 sigio. */ | |
1273 int lmode; | |
1274 #endif | |
1275 | |
1276 #ifdef F_SETOWN | 1250 #ifdef F_SETOWN |
1277 int old_fcntl_owner[MAXDESC]; | 1251 int old_fcntl_owner[MAXDESC]; |
1278 #endif /* F_SETOWN */ | 1252 #endif /* F_SETOWN */ |
1279 | 1253 |
1280 /* This may also be defined in stdio, | 1254 /* This may also be defined in stdio, |
1281 but if so, this does no harm, | 1255 but if so, this does no harm, |
1282 and using the same name avoids wasting the other one's space. */ | 1256 and using the same name avoids wasting the other one's space. */ |
1283 | 1257 |
1284 #ifdef nec_ews_svr4 | |
1285 extern char *_sobuf ; | |
1286 #else | |
1287 #if defined (USG) || defined (DGUX) | 1258 #if defined (USG) || defined (DGUX) |
1288 unsigned char _sobuf[BUFSIZ+8]; | 1259 unsigned char _sobuf[BUFSIZ+8]; |
1289 #else | 1260 #else |
1290 char _sobuf[BUFSIZ]; | 1261 char _sobuf[BUFSIZ]; |
1291 #endif | |
1292 #endif | 1262 #endif |
1293 | 1263 |
1294 #ifdef HAVE_LTCHARS | 1264 #ifdef HAVE_LTCHARS |
1295 static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1}; | 1265 static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1}; |
1296 #endif | 1266 #endif |
1493 tty.main.c_cc[VSTOP] = CDISABLE; | 1463 tty.main.c_cc[VSTOP] = CDISABLE; |
1494 #endif /* VSTOP */ | 1464 #endif /* VSTOP */ |
1495 } | 1465 } |
1496 #endif /* mips or HAVE_TCATTR */ | 1466 #endif /* mips or HAVE_TCATTR */ |
1497 | 1467 |
1498 #ifdef SET_LINE_DISCIPLINE | |
1499 /* Need to explicitly request TERMIODISC line discipline or | |
1500 Ultrix's termios does not work correctly. */ | |
1501 tty.main.c_line = SET_LINE_DISCIPLINE; | |
1502 #endif | |
1503 #ifdef AIX | 1468 #ifdef AIX |
1504 #ifndef IBMR2AIX | 1469 #ifndef IBMR2AIX |
1505 /* AIX enhanced edit loses NULs, so disable it. */ | 1470 /* AIX enhanced edit loses NULs, so disable it. */ |
1506 tty.main.c_line = 0; | 1471 tty.main.c_line = 0; |
1507 tty.main.c_iflag &= ~ASCEDIT; | 1472 tty.main.c_iflag &= ~ASCEDIT; |
1564 tty.tchars.t_startc = '\021'; | 1529 tty.tchars.t_startc = '\021'; |
1565 tty.tchars.t_stopc = '\023'; | 1530 tty.tchars.t_stopc = '\023'; |
1566 } | 1531 } |
1567 | 1532 |
1568 tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | tty_out->old_tty.lmode; | 1533 tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | tty_out->old_tty.lmode; |
1569 #ifdef ultrix | |
1570 /* Under Ultrix 4.2a, leaving this out doesn't seem to hurt | |
1571 anything, and leaving it in breaks the meta key. Go figure. */ | |
1572 tty.lmode &= ~LLITOUT; | |
1573 #endif | |
1574 | 1534 |
1575 #ifdef BSD4_1 | |
1576 lmode = tty.lmode; | |
1577 #endif | |
1578 | |
1579 #endif /* HAVE_TCHARS */ | 1535 #endif /* HAVE_TCHARS */ |
1580 #endif /* not HAVE_TERMIO */ | 1536 #endif /* not HAVE_TERMIO */ |
1581 | 1537 |
1582 #ifdef HAVE_LTCHARS | 1538 #ifdef HAVE_LTCHARS |
1583 tty.ltchars = new_ltchars; | 1539 tty.ltchars = new_ltchars; |
1598 #endif | 1554 #endif |
1599 #ifdef TIOCSTART | 1555 #ifdef TIOCSTART |
1600 if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0); | 1556 if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0); |
1601 #endif | 1557 #endif |
1602 | 1558 |
1603 #if defined (HAVE_TERMIOS) || defined (HPUX9) | 1559 #if defined (HAVE_TERMIOS) || defined (HPUX) |
1604 #ifdef TCOON | 1560 #ifdef TCOON |
1605 if (!tty_out->flow_control) tcflow (fileno (tty_out->input), TCOON); | 1561 if (!tty_out->flow_control) tcflow (fileno (tty_out->input), TCOON); |
1606 #endif | 1562 #endif |
1607 #endif | 1563 #endif |
1608 | |
1609 #ifdef AIXHFT | |
1610 hft_init (tty_out); | |
1611 #ifdef IBMR2AIX | |
1612 { | |
1613 /* IBM's HFT device usually thinks a ^J should be LF/CR. We need it | |
1614 to be only LF. This is the way that is done. */ | |
1615 struct termio tty; | |
1616 | |
1617 if (ioctl (1, HFTGETID, &tty) != -1) | |
1618 write (1, "\033[20l", 5); | |
1619 } | |
1620 #endif | |
1621 #endif /* AIXHFT */ | |
1622 | 1564 |
1623 #ifdef VMS | 1565 #ifdef VMS |
1624 /* Appears to do nothing when in PASTHRU mode. | 1566 /* Appears to do nothing when in PASTHRU mode. |
1625 SYS$QIOW (0, fileno (tty_out->input), IO$_SETMODE|IO$M_OUTBAND, 0, 0, 0, | 1567 SYS$QIOW (0, fileno (tty_out->input), IO$_SETMODE|IO$M_OUTBAND, 0, 0, 0, |
1626 interrupt_signal, oob_chars, 0, 0, 0, 0); | 1568 interrupt_signal, oob_chars, 0, 0, 0, 0); |
1647 #endif /* HAVE_GPM */ | 1589 #endif /* HAVE_GPM */ |
1648 } | 1590 } |
1649 #endif /* F_GETOWN */ | 1591 #endif /* F_GETOWN */ |
1650 #endif /* F_SETFL */ | 1592 #endif /* F_SETFL */ |
1651 | 1593 |
1652 #ifdef BSD4_1 | |
1653 if (interrupt_input) | |
1654 init_sigio (fileno (tty_out->input)); | |
1655 #endif | |
1656 | |
1657 #ifdef VMS /* VMS sometimes has this symbol but lacks setvbuf. */ | 1594 #ifdef VMS /* VMS sometimes has this symbol but lacks setvbuf. */ |
1658 #undef _IOFBF | 1595 #undef _IOFBF |
1659 #endif | 1596 #endif |
1660 #ifdef _IOFBF | 1597 #ifdef _IOFBF |
1661 /* This symbol is defined on recent USG systems. | 1598 /* This symbol is defined on recent USG systems. |
1866 } | 1803 } |
1867 | 1804 |
1868 cmgoto (tty_out, FrameRows (tty_out) - 1, 0); | 1805 cmgoto (tty_out, FrameRows (tty_out) - 1, 0); |
1869 fflush (tty_out->output); | 1806 fflush (tty_out->output); |
1870 | 1807 |
1871 #if defined (IBMR2AIX) && defined (AIXHFT) | |
1872 { | |
1873 /* HFT devices normally use ^J as a LF/CR. We forced it to | |
1874 do the LF only. Now, we need to reset it. */ | |
1875 struct termio tty; | |
1876 | |
1877 if (ioctl (1, HFTGETID, &tty) != -1) | |
1878 write (1, "\033[20h", 5); | |
1879 } | |
1880 #endif | |
1881 | |
1882 if (tty_out->terminal->reset_terminal_modes_hook) | 1808 if (tty_out->terminal->reset_terminal_modes_hook) |
1883 tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal); | 1809 tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal); |
1884 | 1810 |
1885 #ifdef BSD_SYSTEM | 1811 #ifdef BSD_SYSTEM |
1886 #ifndef BSD4_1 | |
1887 /* Avoid possible loss of output when changing terminal modes. */ | 1812 /* Avoid possible loss of output when changing terminal modes. */ |
1888 fsync (fileno (tty_out->output)); | 1813 fsync (fileno (tty_out->output)); |
1889 #endif | |
1890 #endif | 1814 #endif |
1891 | 1815 |
1892 #ifdef F_SETFL | 1816 #ifdef F_SETFL |
1893 #ifdef F_SETOWN /* F_SETFL does not imply existence of F_SETOWN */ | 1817 #ifdef F_SETOWN /* F_SETFL does not imply existence of F_SETOWN */ |
1894 if (interrupt_input) | 1818 if (interrupt_input) |
1901 #ifdef O_NDELAY | 1825 #ifdef O_NDELAY |
1902 fcntl (fileno (tty_out->input), F_SETFL, | 1826 fcntl (fileno (tty_out->input), F_SETFL, |
1903 fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NDELAY); | 1827 fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NDELAY); |
1904 #endif | 1828 #endif |
1905 #endif /* F_SETFL */ | 1829 #endif /* F_SETFL */ |
1906 #ifdef BSD4_1 | |
1907 if (interrupt_input) | |
1908 reset_sigio (fileno (tty_out->input)); | |
1909 #endif /* BSD4_1 */ | |
1910 | 1830 |
1911 if (tty_out->old_tty) | 1831 if (tty_out->old_tty) |
1912 while (EMACS_SET_TTY (fileno (tty_out->input), | 1832 while (EMACS_SET_TTY (fileno (tty_out->input), |
1913 tty_out->old_tty, 0) < 0 && errno == EINTR) | 1833 tty_out->old_tty, 0) < 0 && errno == EINTR) |
1914 ; | 1834 ; |
1915 | 1835 |
1916 #ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */ | 1836 #ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */ |
1917 dos_ttcooked (); | 1837 dos_ttcooked (); |
1918 #endif | |
1919 | |
1920 #ifdef SET_LINE_DISCIPLINE | |
1921 /* Ultrix's termios *ignores* any line discipline except TERMIODISC. | |
1922 A different old line discipline is therefore not restored, yet. | |
1923 Restore the old line discipline by hand. */ | |
1924 ioctl (0, TIOCSETD, &tty_out->old_tty.main.c_line); | |
1925 #endif | |
1926 | |
1927 #ifdef AIXHFT | |
1928 hft_reset (); | |
1929 #endif | 1838 #endif |
1930 | 1839 |
1931 #ifdef BSD_PGRPS | 1840 #ifdef BSD_PGRPS |
1932 widen_foreground_group (fileno (tty_out->input)); | 1841 widen_foreground_group (fileno (tty_out->input)); |
1933 #endif | 1842 #endif |
2316 #endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */ | 2225 #endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */ |
2317 | 2226 |
2318 /* init_system_name sets up the string for the Lisp function | 2227 /* init_system_name sets up the string for the Lisp function |
2319 system-name to return. */ | 2228 system-name to return. */ |
2320 | 2229 |
2321 #ifdef BSD4_1 | |
2322 #include <whoami.h> | |
2323 #endif | |
2324 | |
2325 extern Lisp_Object Vsystem_name; | 2230 extern Lisp_Object Vsystem_name; |
2326 | 2231 |
2327 #ifndef BSD4_1 | |
2328 #ifndef VMS | 2232 #ifndef VMS |
2329 #ifdef HAVE_SOCKETS | 2233 #ifdef HAVE_SOCKETS |
2330 #include <sys/socket.h> | 2234 #include <sys/socket.h> |
2331 #include <netdb.h> | 2235 #include <netdb.h> |
2332 #endif /* HAVE_SOCKETS */ | 2236 #endif /* HAVE_SOCKETS */ |
2333 #endif /* not VMS */ | 2237 #endif /* not VMS */ |
2334 #endif /* not BSD4_1 */ | |
2335 | 2238 |
2336 #ifdef TRY_AGAIN | 2239 #ifdef TRY_AGAIN |
2337 #ifndef HAVE_H_ERRNO | 2240 #ifndef HAVE_H_ERRNO |
2338 extern int h_errno; | 2241 extern int h_errno; |
2339 #endif | 2242 #endif |
2340 #endif /* TRY_AGAIN */ | 2243 #endif /* TRY_AGAIN */ |
2341 | 2244 |
2342 void | 2245 void |
2343 init_system_name () | 2246 init_system_name () |
2344 { | 2247 { |
2345 #ifdef BSD4_1 | |
2346 Vsystem_name = build_string (sysname); | |
2347 #else | |
2348 #ifdef VMS | 2248 #ifdef VMS |
2349 char *sp, *end; | 2249 char *sp, *end; |
2350 if ((sp = egetenv ("SYS$NODE")) == 0) | 2250 if ((sp = egetenv ("SYS$NODE")) == 0) |
2351 Vsystem_name = build_string ("vax-vms"); | 2251 Vsystem_name = build_string ("vax-vms"); |
2352 else if ((end = index (sp, ':')) == 0) | 2252 else if ((end = index (sp, ':')) == 0) |
2523 #endif /* HAVE_SYSINFO && defined (SI_SRPC_DOMAIN) */ | 2423 #endif /* HAVE_SYSINFO && defined (SI_SRPC_DOMAIN) */ |
2524 #endif /* 0 */ | 2424 #endif /* 0 */ |
2525 Vsystem_name = build_string (hostname); | 2425 Vsystem_name = build_string (hostname); |
2526 #endif /* HAVE_GETHOSTNAME */ | 2426 #endif /* HAVE_GETHOSTNAME */ |
2527 #endif /* VMS */ | 2427 #endif /* VMS */ |
2528 #endif /* BSD4_1 */ | |
2529 { | 2428 { |
2530 unsigned char *p; | 2429 unsigned char *p; |
2531 for (p = SDATA (Vsystem_name); *p; p++) | 2430 for (p = SDATA (Vsystem_name); *p; p++) |
2532 if (*p == ' ' || *p == '\t') | 2431 if (*p == ' ' || *p == '\t') |
2533 *p = '-'; | 2432 *p = '-'; |
2565 | 2464 |
2566 SIGTYPE | 2465 SIGTYPE |
2567 select_alarm () | 2466 select_alarm () |
2568 { | 2467 { |
2569 select_alarmed = 1; | 2468 select_alarmed = 1; |
2570 #ifdef BSD4_1 | |
2571 sigrelse (SIGALRM); | |
2572 #else /* not BSD4_1 */ | |
2573 signal (SIGALRM, SIG_IGN); | 2469 signal (SIGALRM, SIG_IGN); |
2574 #endif /* not BSD4_1 */ | |
2575 SIGNAL_THREAD_CHECK (SIGALRM); | 2470 SIGNAL_THREAD_CHECK (SIGALRM); |
2576 if (read_alarm_should_throw) | 2471 if (read_alarm_should_throw) |
2577 longjmp (read_alarm_throw, 1); | 2472 longjmp (read_alarm_throw, 1); |
2578 } | 2473 } |
2579 | 2474 |
2779 #endif | 2674 #endif |
2780 | 2675 |
2781 #endif /* not HAVE_SELECT */ | 2676 #endif /* not HAVE_SELECT */ |
2782 #endif /* not VMS */ | 2677 #endif /* not VMS */ |
2783 #endif /* not MSDOS */ | 2678 #endif /* not MSDOS */ |
2784 | |
2785 #ifdef BSD4_1 | |
2786 void | |
2787 init_sigio (fd) | |
2788 int fd; | |
2789 { | |
2790 if (noninteractive) | |
2791 return; | |
2792 lmode = LINTRUP | lmode; | |
2793 ioctl (fd, TIOCLSET, &lmode); | |
2794 } | |
2795 | |
2796 void | |
2797 reset_sigio (fd) | |
2798 int fd; | |
2799 { | |
2800 if (noninteractive) | |
2801 return; | |
2802 lmode = ~LINTRUP & lmode; | |
2803 ioctl (fd, TIOCLSET, &lmode); | |
2804 } | |
2805 | |
2806 void | |
2807 request_sigio () | |
2808 { | |
2809 if (noninteractive) | |
2810 return; | |
2811 sigrelse (SIGTINT); | |
2812 | |
2813 interrupts_deferred = 0; | |
2814 } | |
2815 | |
2816 void | |
2817 unrequest_sigio () | |
2818 { | |
2819 if (noninteractive) | |
2820 return; | |
2821 sighold (SIGTINT); | |
2822 | |
2823 interrupts_deferred = 1; | |
2824 } | |
2825 | |
2826 /* still inside #ifdef BSD4_1 */ | |
2827 #ifdef subprocesses | |
2828 | |
2829 int sigheld; /* Mask of held signals */ | |
2830 | |
2831 void | |
2832 sigholdx (signum) | |
2833 int signum; | |
2834 { | |
2835 sigheld |= sigbit (signum); | |
2836 sighold (signum); | |
2837 } | |
2838 | |
2839 void | |
2840 sigisheld (signum) | |
2841 int signum; | |
2842 { | |
2843 sigheld |= sigbit (signum); | |
2844 } | |
2845 | |
2846 void | |
2847 sigunhold (signum) | |
2848 int signum; | |
2849 { | |
2850 sigheld &= ~sigbit (signum); | |
2851 sigrelse (signum); | |
2852 } | |
2853 | |
2854 void | |
2855 sigfree () /* Free all held signals */ | |
2856 { | |
2857 int i; | |
2858 for (i = 0; i < NSIG; i++) | |
2859 if (sigheld & sigbit (i)) | |
2860 sigrelse (i); | |
2861 sigheld = 0; | |
2862 } | |
2863 | |
2864 int | |
2865 sigbit (i) | |
2866 { | |
2867 return 1 << (i - 1); | |
2868 } | |
2869 #endif /* subprocesses */ | |
2870 #endif /* BSD4_1 */ | |
2871 | 2679 |
2872 /* POSIX signals support - DJB */ | 2680 /* POSIX signals support - DJB */ |
2873 /* Anyone with POSIX signals should have ANSI C declarations */ | 2681 /* Anyone with POSIX signals should have ANSI C declarations */ |
2874 | 2682 |
2875 #ifdef POSIX_SIGNALS | 2683 #ifdef POSIX_SIGNALS |
3325 const char *path; | 3133 const char *path; |
3326 int oflag, mode; | 3134 int oflag, mode; |
3327 { | 3135 { |
3328 register int rtnval; | 3136 register int rtnval; |
3329 | 3137 |
3330 #ifdef BSD4_1 | |
3331 if (oflag & O_CREAT) | |
3332 return creat (path, mode); | |
3333 #endif | |
3334 | |
3335 while ((rtnval = open (path, oflag, mode)) == -1 | 3138 while ((rtnval = open (path, oflag, mode)) == -1 |
3336 && (errno == EINTR)) | 3139 && (errno == EINTR)) |
3337 QUIT; | 3140 QUIT; |
3338 return (rtnval); | 3141 return (rtnval); |
3339 } | 3142 } |
5187 { | 4990 { |
5188 srand (seed); | 4991 srand (seed); |
5189 } | 4992 } |
5190 #endif /* VMS */ | 4993 #endif /* VMS */ |
5191 | 4994 |
5192 #ifdef AIXHFT | |
5193 | |
5194 /* Called from init_sys_modes. */ | |
5195 void | |
5196 hft_init (struct tty_display_info *tty_out) | |
5197 { | |
5198 int junk; | |
5199 | |
5200 /* If we're not on an HFT we shouldn't do any of this. We determine | |
5201 if we are on an HFT by trying to get an HFT error code. If this | |
5202 call fails, we're not on an HFT. */ | |
5203 #ifdef IBMR2AIX | |
5204 if (ioctl (0, HFQERROR, &junk) < 0) | |
5205 return; | |
5206 #else /* not IBMR2AIX */ | |
5207 if (ioctl (0, HFQEIO, 0) < 0) | |
5208 return; | |
5209 #endif /* not IBMR2AIX */ | |
5210 | |
5211 /* On AIX the default hft keyboard mapping uses backspace rather than delete | |
5212 as the rubout key's ASCII code. Here this is changed. The bug is that | |
5213 there's no way to determine the old mapping, so in reset_sys_modes | |
5214 we need to assume that the normal map had been present. Of course, this | |
5215 code also doesn't help if on a terminal emulator which doesn't understand | |
5216 HFT VTD's. */ | |
5217 { | |
5218 struct hfbuf buf; | |
5219 struct hfkeymap keymap; | |
5220 | |
5221 buf.hf_bufp = (char *)&keymap; | |
5222 buf.hf_buflen = sizeof (keymap); | |
5223 keymap.hf_nkeys = 2; | |
5224 keymap.hfkey[0].hf_kpos = 15; | |
5225 keymap.hfkey[0].hf_kstate = HFMAPCHAR | HFSHFNONE; | |
5226 #ifdef IBMR2AIX | |
5227 keymap.hfkey[0].hf_keyidh = '<'; | |
5228 #else /* not IBMR2AIX */ | |
5229 keymap.hfkey[0].hf_page = '<'; | |
5230 #endif /* not IBMR2AIX */ | |
5231 keymap.hfkey[0].hf_char = 127; | |
5232 keymap.hfkey[1].hf_kpos = 15; | |
5233 keymap.hfkey[1].hf_kstate = HFMAPCHAR | HFSHFSHFT; | |
5234 #ifdef IBMR2AIX | |
5235 keymap.hfkey[1].hf_keyidh = '<'; | |
5236 #else /* not IBMR2AIX */ | |
5237 keymap.hfkey[1].hf_page = '<'; | |
5238 #endif /* not IBMR2AIX */ | |
5239 keymap.hfkey[1].hf_char = 127; | |
5240 hftctl (0, HFSKBD, &buf); | |
5241 } | |
5242 } | |
5243 | |
5244 /* Reset the rubout key to backspace. */ | |
5245 | |
5246 void | |
5247 hft_reset (struct tty_display_info *tty_out) | |
5248 { | |
5249 struct hfbuf buf; | |
5250 struct hfkeymap keymap; | |
5251 int junk; | |
5252 | |
5253 #ifdef IBMR2AIX | |
5254 if (ioctl (0, HFQERROR, &junk) < 0) | |
5255 return; | |
5256 #else /* not IBMR2AIX */ | |
5257 if (ioctl (0, HFQEIO, 0) < 0) | |
5258 return; | |
5259 #endif /* not IBMR2AIX */ | |
5260 | |
5261 buf.hf_bufp = (char *)&keymap; | |
5262 buf.hf_buflen = sizeof (keymap); | |
5263 keymap.hf_nkeys = 2; | |
5264 keymap.hfkey[0].hf_kpos = 15; | |
5265 keymap.hfkey[0].hf_kstate = HFMAPCHAR | HFSHFNONE; | |
5266 #ifdef IBMR2AIX | |
5267 keymap.hfkey[0].hf_keyidh = '<'; | |
5268 #else /* not IBMR2AIX */ | |
5269 keymap.hfkey[0].hf_page = '<'; | |
5270 #endif /* not IBMR2AIX */ | |
5271 keymap.hfkey[0].hf_char = 8; | |
5272 keymap.hfkey[1].hf_kpos = 15; | |
5273 keymap.hfkey[1].hf_kstate = HFMAPCHAR | HFSHFSHFT; | |
5274 #ifdef IBMR2AIX | |
5275 keymap.hfkey[1].hf_keyidh = '<'; | |
5276 #else /* not IBMR2AIX */ | |
5277 keymap.hfkey[1].hf_page = '<'; | |
5278 #endif /* not IBMR2AIX */ | |
5279 keymap.hfkey[1].hf_char = 8; | |
5280 hftctl (0, HFSKBD, &buf); | |
5281 } | |
5282 | |
5283 #endif /* AIXHFT */ | |
5284 | |
5285 | |
5286 #ifndef BSTRING | 4995 #ifndef BSTRING |
5287 | 4996 |
5288 #ifndef bzero | 4997 #ifndef bzero |
5289 | 4998 |
5290 void | 4999 void |