Path: utzoo!attcan!uunet!lll-winken!elroy.jpl.nasa.gov!usc!cs.utexas.edu!rice!sun-spots-request From: chet@po.cwru.edu Newsgroups: comp.sys.sun Subject: Re: 4.1 and ksh88d Keywords: Miscellaneous Message-ID: <9991@brazos.Rice.edu> Date: 16 Jul 90 22:44:08 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 21 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n254 X-Sun-Spots-Digest: Volume 9, Issue 268, message 2 In article <9833@brazos.Rice.edu> marg@cunixf.cc.columbia.edu (Margarita Suarez) writes: [An explanation of why sometimes the last process in a pipeline would hang ksh88d, and finally traced it down to a setpgid() race condition where a process in the pipeline would try to set its pgrp before the process group `leader' had established the process group. This resulted in a pipeline with pieces in different process groups.] >To fix, check for the case where setpgid returns ENOPERM, and if so, sleep >a bit and try again until the process group leader has been properly >established. A better fix is to do the setpgid() in both the parent and child, so the setpgid() succeeds before anything else happens. It doesn't matter which succeeds, as long as the pgrp is set before anything else depends on it being so. Chet Ramey "...but worst of all, young man, Network Services Group you've got Industrial Disease!" Case Western Reserve University chet@ins.CWRU.Edu