Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpfcdc!rml From: rml@hpfcdc.HP.COM (Bob Lenk) Newsgroups: comp.unix.questions Subject: Re: setpgrp question Message-ID: <5740046@hpfcdc.HP.COM> Date: 27 Dec 89 00:53:58 GMT References: <6863@cbnewsh.ATT.COM> Organization: HP Ft. Collins, Co. Lines: 30 In article <6863@cbnewsh.ATT.COM> skumar@cbnewsh.ATT.COM (swaminathan.ravikumar) writes: > 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. Process groups are used in two different ways on different implementations. In System V they are used to group the processes that are logged in on a terminal. In BSD they are used to group processes into jobs. While both versions permit sending a signal to a process group, there are other effects based on the intended usage which may not be expected if you just want to group processes for signals. Disassociating from the controlling terminal is one effect that goes with the System V usage. The effects in BSD include distinguishing one process group as the foreground process group of a tty and restricting access from other (background) processes. The IEEE 1003.1 (POSIX.1) standard includes both types of grouping. The System V style process groups are called sessions, while the BSD style are called process groups. The setpgrp() function is not in POSIX (to permit backward compatibility with either version), but is replaced with the two calls setsid() and setpgid(). Bob Lenk rml@hpfcla.hp.com hplabs!hpfcla!rml