Hello,
Recently I've begun working with process management functions on Sun
sparc systems running SunOS 5.6. I have encountered a strange problem
with tcsetpgrp and have had trouble completely understanding tcsetpgrp
etc. For example, why would something like this (some error checking
omitted):
pid_t cpid;
int status;
if ((cpid = fork()) < 0) /* die, omitted */;
if (cpid == 0) {
setpgid(0, 0);
tcsetpgrp(STDIN_FILENO, getpgid((pid_t)0));
execl("/bin/vi", "vi", (char *)NULL);
perror("error");
exit(errno);
}
/* in parent */
setpgid(cpid, cpid);
tcsetpgrp(STDIN_FILENO, cpid);
wait(&status);
tcsetpgrp(STDIN_FILENO, /* parent id.. */);
etc...
not work?
The problem seems to be resolved if I block the SIGTTOU signal in the
child.. however, if I leave the default behavior for SIGTTOU, the
process gets stopped.. and ctrl-z, ctrl-c etc.. cannot touch it.. might
anyone be able to explain this? And perhaps fill in any other details
about this call/this set of calls that might be useful? Thanks very
much!
-Z
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!