Mercurial > hg > xemacs-beta
comparison src/sysdep.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 | 360340f9fd5f |
comparison
equal
deleted
inserted
replaced
99:2d83cbd90d8d | 100:4be1180a9e89 |
---|---|
59 #endif | 59 #endif |
60 #include "sysfile.h" | 60 #include "sysfile.h" |
61 #include "syswait.h" | 61 #include "syswait.h" |
62 #include "sysdir.h" | 62 #include "sysdir.h" |
63 #include "systime.h" | 63 #include "systime.h" |
64 #if defined(WINDOWSNT) | |
65 #include "syssignal.h" | |
66 #else | |
64 #include <sys/times.h> | 67 #include <sys/times.h> |
68 #endif | |
65 | 69 |
66 /* ------------------------------- */ | 70 /* ------------------------------- */ |
67 /* VMS includes */ | 71 /* VMS includes */ |
68 /* ------------------------------- */ | 72 /* ------------------------------- */ |
69 | 73 |
424 #endif | 428 #endif |
425 } | 429 } |
426 | 430 |
427 #ifndef VMS | 431 #ifndef VMS |
428 #ifndef MSDOS | 432 #ifndef MSDOS |
433 #ifndef WINDOWSNT | |
429 /* Set up the terminal at the other end of a pseudo-terminal that | 434 /* Set up the terminal at the other end of a pseudo-terminal that |
430 we will be controlling an inferior through. | 435 we will be controlling an inferior through. |
431 It should not echo or do line-editing, since that is done | 436 It should not echo or do line-editing, since that is done |
432 in Emacs. No padding needed for insertion into an Emacs buffer. */ | 437 in Emacs. No padding needed for insertion into an Emacs buffer. */ |
433 | 438 |
451 s.main.c_iflag &= ~IUCLC; /* Disable downcasing on input. */ | 456 s.main.c_iflag &= ~IUCLC; /* Disable downcasing on input. */ |
452 #endif | 457 #endif |
453 #ifdef OLCUC | 458 #ifdef OLCUC |
454 s.main.c_oflag &= ~OLCUC; /* Disable upcasing on output. */ | 459 s.main.c_oflag &= ~OLCUC; /* Disable upcasing on output. */ |
455 #endif | 460 #endif |
461 s.main.c_oflag &= ~TAB3; /* Disable tab expansion */ | |
456 #if defined (CSIZE) && defined (CS8) | 462 #if defined (CSIZE) && defined (CS8) |
457 s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */ | 463 s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */ |
458 #endif | 464 #endif |
459 #ifdef ISTRIP | 465 #ifdef ISTRIP |
460 s.main.c_iflag &= ~ISTRIP; /* Don't strip 8th bit on input */ | 466 s.main.c_iflag &= ~ISTRIP; /* Don't strip 8th bit on input */ |
530 int zero = 0; | 536 int zero = 0; |
531 ioctl (out, FIOASYNC, &zero); | 537 ioctl (out, FIOASYNC, &zero); |
532 } | 538 } |
533 #endif /* RTU */ | 539 #endif /* RTU */ |
534 } | 540 } |
541 #endif /* WINDOWSNT */ | |
535 #endif /* not MSDOS */ | 542 #endif /* not MSDOS */ |
536 #endif /* not VMS */ | 543 #endif /* not VMS */ |
537 | 544 |
538 #endif /* not NO_SUBPROCESSES */ | 545 #endif /* not NO_SUBPROCESSES */ |
539 | 546 |
1295 | 1302 |
1296 /* ------------------------------------------------------ */ | 1303 /* ------------------------------------------------------ */ |
1297 /* Getting and setting emacs_tty structures */ | 1304 /* Getting and setting emacs_tty structures */ |
1298 /* ------------------------------------------------------ */ | 1305 /* ------------------------------------------------------ */ |
1299 | 1306 |
1307 #ifdef HAVE_TTY | |
1308 | |
1300 /* Set *TC to the parameters associated with the terminal FD. | 1309 /* Set *TC to the parameters associated with the terminal FD. |
1301 Return zero if all's well, or -1 if we ran into an error we | 1310 Return zero if all's well, or -1 if we ran into an error we |
1302 couldn't deal with. */ | 1311 couldn't deal with. */ |
1303 int | 1312 int |
1304 emacs_get_tty (int fd, struct emacs_tty *settings) | 1313 emacs_get_tty (int fd, struct emacs_tty *settings) |
1433 #endif | 1442 #endif |
1434 | 1443 |
1435 /* We have survived the tempest. */ | 1444 /* We have survived the tempest. */ |
1436 return 0; | 1445 return 0; |
1437 } | 1446 } |
1447 | |
1448 #endif | |
1438 | 1449 |
1439 | 1450 |
1440 /* ------------------------------------------------------ */ | 1451 /* ------------------------------------------------------ */ |
1441 /* Initializing a device */ | 1452 /* Initializing a device */ |
1442 /* ------------------------------------------------------ */ | 1453 /* ------------------------------------------------------ */ |
3410 for increased accuracy. */ | 3421 for increased accuracy. */ |
3411 | 3422 |
3412 static int | 3423 static int |
3413 get_process_times_1 (long *user_ticks, long *system_ticks) | 3424 get_process_times_1 (long *user_ticks, long *system_ticks) |
3414 { | 3425 { |
3415 #if defined (_SC_CLK_TCK) || defined (CLK_TCK) | 3426 #if defined (_SC_CLK_TCK) || defined (CLK_TCK) && !defined(WINDOWSNT) |
3416 /* We have the POSIX times() function available. */ | 3427 /* We have the POSIX times() function available. */ |
3417 struct tms tttt; | 3428 struct tms tttt; |
3418 times (&tttt); | 3429 times (&tttt); |
3419 *user_ticks = (long) tttt.tms_utime; | 3430 *user_ticks = (long) tttt.tms_utime; |
3420 *system_ticks = (long) tttt.tms_stime; | 3431 *system_ticks = (long) tttt.tms_stime; |
3421 return 1; | 3432 return 1; |
3422 #elif defined (CLOCKS_PER_SEC) | 3433 #elif defined (CLOCKS_PER_SEC) |
3423 *user_time = (long) clock (); | 3434 *user_ticks = (long) clock (); |
3424 *system_time = 0; | 3435 *system_ticks = 0; |
3425 return 1; | 3436 return 1; |
3426 #else | 3437 #else |
3427 return 0; | 3438 return 0; |
3428 #endif | 3439 #endif |
3429 } | 3440 } |
3561 /************************************************************************/ | 3572 /************************************************************************/ |
3562 /* Strings corresponding to defined signals */ | 3573 /* Strings corresponding to defined signals */ |
3563 /************************************************************************/ | 3574 /************************************************************************/ |
3564 | 3575 |
3565 #if !defined (SYS_SIGLIST_DECLARED) && !defined (HAVE_SYS_SIGLIST) | 3576 #if !defined (SYS_SIGLIST_DECLARED) && !defined (HAVE_SYS_SIGLIST) |
3577 | |
3578 #ifdef WINDOWSNT | |
3579 char *sys_siglist[] = | |
3580 { | |
3581 "bum signal!!", | |
3582 "hangup", | |
3583 "interrupt", | |
3584 "quit", | |
3585 "illegal instruction", | |
3586 "trace trap", | |
3587 "iot instruction", | |
3588 "emt instruction", | |
3589 "floating point exception", | |
3590 "kill", | |
3591 "bus error", | |
3592 "segmentation violation", | |
3593 "bad argument to system call", | |
3594 "write on a pipe with no one to read it", | |
3595 "alarm clock", | |
3596 "software termination signal from kill", | |
3597 "status signal", | |
3598 "sendable stop signal not from tty", | |
3599 "stop signal from tty", | |
3600 "continue a stopped process", | |
3601 "child status has changed", | |
3602 "background read attempted from control tty", | |
3603 "background write attempted from control tty", | |
3604 "input record available at control tty", | |
3605 "exceeded CPU time limit", | |
3606 "exceeded file size limit" | |
3607 }; | |
3608 #endif | |
3566 | 3609 |
3567 #ifdef USG | 3610 #ifdef USG |
3568 #ifdef AIX | 3611 #ifdef AIX |
3569 CONST char *sys_siglist[NSIG + 1] = | 3612 CONST char *sys_siglist[NSIG + 1] = |
3570 { | 3613 { |