tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

FIOSETOWN and TIOCSPGRP vs control ttys



In sys/kern/tty.c, I find

	case FIOSETOWN: {		/* set pgrp of tty */
[...]
		if (tp->t_session != NULL && !isctty(p, tp)) {
			mutex_exit(proc_lock);
			return (ENOTTY);
		}

and

	case TIOCSPGRP: {		/* set pgrp of tty */
[...]
		if (!isctty(p, tp)) {
			mutex_exit(proc_lock);
			return (ENOTTY);
		}

These are being a problem for me; I want to open up two ttys, neither
being my control tty, and get SIGIO when I/O is possible on either.
Obviously, I can just build a kernel with those tests snipped out;
indeed, I'm doing exactly that to see if my code works then.

But I'm wondering why those checks are there, wondering what hazard I'm
risking by removing them.  Anyone happen to know?

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index