Subject: F_SETOWN broken?
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu>
From: Brad Parker <brad@fcr.com>
List: netbsd-bugs
Date: 11/10/1993 15:45:02
[using netnsd-current]

Can anyone explain why F_SETOWN to a tty checks for controlling terminal?
I'm no posix weenie - is this POSIX?  If so, why?

(fyi: sunos does not seem to do this check;  I know that's no excuse, but
it's a data point)

I even checked my "Stevens book" and could find no explaination.  Am I
lost?  (wait - don't answer that).

in tty.c, ttioctl() does:

        /*
         * Set terminal process group.
         */
        case TIOCSPGRP: {
                register struct pgrp *pgrp = pgfind(*(int *)data);

                if (!isctty(p, tp))
                        return (ENOTTY);
                else if (pgrp == NULL || pgrp->pg_session != p->p_session)
                        return (EPERM);
                tp->t_pgrp = pgrp;
                break;
        }

-brad

------------------------------------------------------------------------------