Mercurial > hg > xemacs-beta
comparison src/process-unix.c @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | abe6d1db359e |
children | c33ae14dd6d0 |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
1405 /* If the subtty field of the process data is not filled in, do so now. */ | 1405 /* If the subtty field of the process data is not filled in, do so now. */ |
1406 static void | 1406 static void |
1407 try_to_initialize_subtty (struct unix_process_data *upd) | 1407 try_to_initialize_subtty (struct unix_process_data *upd) |
1408 { | 1408 { |
1409 if (upd->pty_flag | 1409 if (upd->pty_flag |
1410 && (upd->subtty = -1 || ! isatty (upd->subtty)) | 1410 && (upd->subtty == -1 || ! isatty (upd->subtty)) |
1411 && STRINGP (upd->tty_name)) | 1411 && STRINGP (upd->tty_name)) |
1412 upd->subtty = open (XSTRING_DATA (upd->tty_name), O_RDWR, 0); | 1412 upd->subtty = open ((char *) XSTRING_DATA (upd->tty_name), O_RDWR, 0); |
1413 } | 1413 } |
1414 | 1414 |
1415 /* Send signal number SIGNO to PROCESS. | 1415 /* Send signal number SIGNO to PROCESS. |
1416 CURRENT_GROUP means send to the process group that currently owns | 1416 CURRENT_GROUP means send to the process group that currently owns |
1417 the terminal being used to communicate with PROCESS. | 1417 the terminal being used to communicate with PROCESS. |
1473 many systems. POSIX tcgetpgrp(), since it is *documented* as not | 1473 many systems. POSIX tcgetpgrp(), since it is *documented* as not |
1474 doing what we want, is actually less likely to work than the BSD | 1474 doing what we want, is actually less likely to work than the BSD |
1475 ioctl TIOCGPGRP it is supposed to obsolete. Sometimes we have to | 1475 ioctl TIOCGPGRP it is supposed to obsolete. Sometimes we have to |
1476 use TIOCGPGRP on the master end, sometimes the slave end | 1476 use TIOCGPGRP on the master end, sometimes the slave end |
1477 (probably an AIX bug). So we better get a fd for the slave if we | 1477 (probably an AIX bug). So we better get a fd for the slave if we |
1478 haven't got it yet. On some systems none of these work, so then | 1478 haven't got it yet. |
1479 we just fall back to the non-current_group behavior and kill the | 1479 |
1480 process group of the child. */ | 1480 Anal operating systems like SGI Irix and Compaq Tru64 adhere |
1481 strictly to the letter of the law, so our hack doesn't work. | |
1482 The following fragment from an Irix header file is suggestive: | |
1483 | |
1484 #ifdef __notdef__ | |
1485 // this is not currently supported | |
1486 #define TIOCSIGNAL (tIOC|31) // pty: send signal to slave | |
1487 #endif | |
1488 | |
1489 On those systems where none of our tricks work, we just fall back | |
1490 to the non-current_group behavior and kill the process group of | |
1491 the child. | |
1492 */ | |
1481 if (current_group) | 1493 if (current_group) |
1482 { | 1494 { |
1483 try_to_initialize_subtty (d); | 1495 try_to_initialize_subtty (d); |
1484 | 1496 |
1485 #ifdef SIGNALS_VIA_CHARACTERS | 1497 #ifdef SIGNALS_VIA_CHARACTERS |