I am seeing an intermittent problem on Red Hat Enterprise Linux 5.4 and 5.6,
and HP-UX 11.0 and 11.31.
The processes launched from the AST ksh sometimes "own" the terminal, and
sometimes don't.
Output from the test program below demonstrates the issue:
[fbg@sturgeon ~]$ /opt/ast/bin/ksh
$ /tmp/testprocessgroup_linux64
PID: 8678 MY_pgrp=8678 STDIN_PGRP:8674 --DO NOT own terminal
$ /tmp/testprocessgroup_linux64
PID: 8679 MY_pgrp=8679 STDIN_PGRP:8679 --own terminal
$ /tmp/testprocessgroup_linux64
PID: 8680 MY_pgrp=8680 STDIN_PGRP:8680 --own terminal
$ /tmp/testprocessgroup_linux64
PID: 8681 MY_pgrp=8681 STDIN_PGRP:8681 --own terminal
$ /tmp/testprocessgroup_linux64
PID: 8682 MY_pgrp=8682 STDIN_PGRP:8674 --DO NOT own terminal
$ /tmp/testprocessgroup_linux64
PID: 8683 MY_pgrp=8683 STDIN_PGRP:8683 --own terminal
$ /tmp/testprocessgroup_linux64
PID: 8684 MY_pgrp=8684 STDIN_PGRP:8674 --DO NOT own terminal
$
[fbg@sturgeon pgrp]$ cat testprocessgroup.c
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char **argv)
{
int devtty;
printf("PID:%5lu MY_pgrp=%d STDIN_PGRP:%d --%s\n",
getpid(),
getpgid(getpid()),
tcgetpgrp(fileno(stdin)),
tcgetpgrp(fileno(stdin)) == getpgid(getpid()) ? "own terminal" :
"DO NOT own terminal" );
return(0);
}
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers