[comp.unix.ultrix] TIOCSPGRP misbehaviour under Ultrix 3.1C

D. Allen [CGL]" <idallen@watcgl.waterloo.edu> (12/11/90)

I'd try this under Ultrix 4.1, but DEC just shipped me 4.0 on Friday
along with our DECsystem 5000 boxes, and I'm told you can't boot a
fully-configured turbo 5000 off Ultrix 4.0.  Why do they ship me software
that won't boot my hardware?  But I digress.

I have a command that uses TIOCSPGRP to set a tty process group.  Given
a process id, it uses setpgrp.  Watch this:

    % setpgrp 6612 /dev/ttyq6
    /dev/ttyq6: Not owner
    % sleep 999 &
    [1] 5585
    % setpgrp 6612 5585
    % setpgrp 6612 /dev/ttyq6       -- why does this work now?
    % kill 5585
    [1]     5585 Terminated            sleep 999
    % setpgrp 6612 /dev/ttyq6       -- and why does it stop now?
    /dev/ttyq6: Not owner

ttyq6 is mode 777, owned by me, and has my mail process on it in pgrp
6612.  That's all.  With that mail process on it, the TIOCSPGRP of its
tty to the pgrp of the mail process fails.  If I start up another process
(on any tty) and put that process in the pgrp of the mail process, now
the TIOCSPGRP succeeds.  Go figure.

I can't find anything that says what the TIOCSPGRP rules are, and the
above mystifies me.
-- 
-IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada