tty_pts.c (158126) | tty_pts.c (162711) |
---|---|
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> | 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 $"); | 43__FBSDID("$FreeBSD: head/sys/kern/tty_pts.c 162711 2006-09-27 19:57:02Z ru $"); |
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; | 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#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ 645 defined(COMPAT_FREEBSD4) || defined(COMPAT_43) 646 int ival; 647#endif |
|
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 | 648 649 switch (cmd) { 650 651 case TIOCGPGRP: 652 /* 653 * We avoid calling ttioctl on the controller since, 654 * in that case, tp must be the controlling terminal. 655 */ --- 53 unchanged lines hidden (view full) --- 709 /* 710 * IF CONTROLLER STTY THEN MUST FLUSH TO PREVENT A HANG. 711 * ttywflush(tp) will hang if there are characters in 712 * the outq. 713 */ 714 ndflush(&tp->t_outq, tp->t_outq.c_cc); 715 break; 716 |
717#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ 718 defined(COMPAT_FREEBSD4) || defined(COMPAT_43) 719 case _IO('t', 95): 720 ival = IOCPARM_IVAL(data); 721 data = (caddr_t)&ival; 722 /* FALLTHROUGH */ 723#endif |
|
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 --- | 724 case TIOCSIG: 725 if (*(unsigned int *)data >= NSIG || 726 *(unsigned int *)data == 0) 727 return(EINVAL); 728 if ((tp->t_lflag&NOFLSH) == 0) 729 ttyflush(tp, FREAD|FWRITE); 730 if (tp->t_pgrp != NULL) { 731 PGRP_LOCK(tp->t_pgrp); --- 162 unchanged lines hidden --- |