setpgrp question

swaminathan.ravikumar skumar at cbnewsh.ATT.COM
Sat Dec 23 02:05:16 AEST 1989


If the following program is run you get the following error
message:

    "pg cannot reopen stdout"

By reading different sources I found out that a process can
break its control terminal by calling "setpgrp". I don't
understand this 100%. Why should the process lose the control
terminal? why do you need "setpgrp"?
I know that it is used to group processes to receive
signals. Does this mean that the processes in the group cannot
use stdin/stdout. I would like to hear from anybody who has used
this call in a real application to understand this better.

	#include <stdio.h>

	main()
	{
	    setpgrp();
	    system("pg /usr/tmp/junk");
	}

Thanks.

-- ravi
skumar at hocus.att.com



More information about the Comp.unix.questions mailing list