Trouble killing processes in SysV/AT

Greg Limes limes at sun.uucp
Tue May 3 11:46:41 AEST 1988


In article <11291 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>In article <51443 at 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 at sun.com]				frames to /dev/fb



More information about the Comp.unix.wizards mailing list