Deleted Added
sdiff udiff text old ( 158126 ) new ( 162711 )
full compact
1/*
2 * Copyright (c) 2006 Robert N. M. Watson
3 * Copyright (c) 2006 Olivier Houchard
4 * Copyright (c) 2003 Networks Associates Technology, Inc.
5 * All rights reserved.
6 *
7 * This software was developed for the FreeBSD Project in part by Network
8 * Associates Laboratories, the Security Research Division of Network

--- 26 unchanged lines hidden (view full) ---

35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95
40 */
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/sys/kern/tty_pts.c 158126 2006-04-28 21:39:57Z rwatson $");
44
45/*
46 * Pseudo-teletype Driver
47 * (Actually two drivers, requiring two entries in 'cdevsw')
48 */
49#include "opt_compat.h"
50#include "opt_tty.h"
51#include <sys/param.h>

--- 584 unchanged lines hidden (view full) ---

636 goto again;
637}
638
639static int
640ptcioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
641{
642 struct tty *tp = dev->si_tty;
643 struct pt_desc *pt = dev->si_drv1;
644
645 switch (cmd) {
646
647 case TIOCGPGRP:
648 /*
649 * We avoid calling ttioctl on the controller since,
650 * in that case, tp must be the controlling terminal.
651 */

--- 53 unchanged lines hidden (view full) ---

705 /*
706 * IF CONTROLLER STTY THEN MUST FLUSH TO PREVENT A HANG.
707 * ttywflush(tp) will hang if there are characters in
708 * the outq.
709 */
710 ndflush(&tp->t_outq, tp->t_outq.c_cc);
711 break;
712
713 case TIOCSIG:
714 if (*(unsigned int *)data >= NSIG ||
715 *(unsigned int *)data == 0)
716 return(EINVAL);
717 if ((tp->t_lflag&NOFLSH) == 0)
718 ttyflush(tp, FREAD|FWRITE);
719 if (tp->t_pgrp != NULL) {
720 PGRP_LOCK(tp->t_pgrp);

--- 162 unchanged lines hidden ---