Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!limes From: limes@sun.uucp (Greg Limes) Newsgroups: comp.unix.wizards Subject: Re: Trouble killing processes in SysV/AT Message-ID: <51698@sun.uucp> Date: 3 May 88 01:46:41 GMT References: <3950@killer.UUCP> <3951@killer.UUCP> <468@micropen> <51443@sun.uucp> <11291@mimsy.UUCP> Reply-To: limes@sun.UUCP (Greg Limes) Organization: Sun Microsystems, Mountain View Lines: 29 In article <11291@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >In article <51443@sun.uucp> I write: >>If the sleep priority is above PZERO, the [signalled] sleep() will return >>an error corresponding to "I was interrupted!". > >Unless Sun has made some big kernel changes recently, this is not the >case. See /sys/sys/kern_synch.c, at the label `psig' in sleep(). Yes, I remembered this wrong. No excuse for that, since my job is to dig around in the kernel; better I should learn by putting my foot in my mouth *here* than by introducing a bug in the kernel. HOWEVER, a change was introduced in the SunOS 3.2(*) kernel in January of 1986 that ... well, here is the comment from the log entry: add feature to allow caller of sleep to catch signals and cause sleep to return (instead of longjmp) so caller can release resources, etc. These two lines were added to the comment at the top of sleep(): * If pri&PCATCH is set, signals will cause sleep * to return 1, rather than longjmp. and the code was revised as described in the comment. Oh, this PCATCH bit comes in handy for code that should be interruptable, but can not release all resources before sleeping. -- Greg Limes [limes@sun.com] frames to /dev/fb