Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!aurora!labrea!decwrl!pyramid!prls!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.unix.wizards Subject: Re: Setting process groups Message-ID: <910@mcgill-vision.UUCP> Date: Wed, 18-Nov-87 07:21:21 EST Article-I.D.: mcgill-v.910 Posted: Wed Nov 18 07:21:21 1987 Date-Received: Fri, 27-Nov-87 00:03:43 EST References: <1765@unc.cs.unc.edu> Organization: McGill University, Montreal Lines: 26 In article <1765@unc.cs.unc.edu>, southard@unc.cs.unc.edu (Scott Southard) writes: > I am writing a program that creates several child processes, and at > some point I would like to kill all the children, but not the parent, > with a killpg() call. How do I set the process group id of all the > children to the same id, but not to the id used by the parent? setpgrp(2). (Please mention what sort of system you are on. In this case, I assume, since you are talking about process groups, that you are on a Berkeley derivative UNIX.) > Can I just pick a process group id to assign to the children that is > different than the one used by the parent? How can I determine what > process group id's are not in use? Any help on this would be > appreciated. The only way, as far as I know, to determine what process groups are in use is a ps-like program which scans the process table. However, the convention is that the process group of all processes in a job is the process ID of the job leader. Thus, for your application, I would say you could pick one of the children and use its process ID as the process group number to give all of them. der Mouse (mouse@mcgill-vision.uucp)