pty.c (9851) | pty.c (9858) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 57 unchanged lines hidden (view full) --- 66struct tty pt_tty[NPTY]; /* XXX */ 67struct pt_ioctl { 68 int pt_flags; 69 struct selinfo pt_selr, pt_selw; 70 u_char pt_send; 71 u_char pt_ucntl; 72} pt_ioctl[NPTY]; /* XXX */ 73int npty = NPTY; /* for pstat -t */ | 1/* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 57 unchanged lines hidden (view full) --- 66struct tty pt_tty[NPTY]; /* XXX */ 67struct pt_ioctl { 68 int pt_flags; 69 struct selinfo pt_selr, pt_selw; 70 u_char pt_send; 71 u_char pt_ucntl; 72} pt_ioctl[NPTY]; /* XXX */ 73int npty = NPTY; /* for pstat -t */ |
74static int validspeed[] = { 75 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 76 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200 77}; 78#define MAX_SPEED (sizeof(validspeed)/sizeof(*validspeed) - 1) | |
79 80#define PF_PKT 0x08 /* packet mode */ 81#define PF_STOPPED 0x10 /* user told stopped */ 82#define PF_REMOTE 0x20 /* remote and flow controlled input */ 83#define PF_NOSTOP 0x40 84#define PF_UCNTL 0x80 /* user control mode */ 85 86void ptsstop __P((struct tty *, int)); --- 557 unchanged lines hidden (view full) --- 644 ttyflush(tp, FREAD|FWRITE); 645 return (0); 646 647#ifdef COMPAT_43 648 case TIOCSETP: 649 case TIOCSETN: 650#endif 651 case TIOCSETD: | 74 75#define PF_PKT 0x08 /* packet mode */ 76#define PF_STOPPED 0x10 /* user told stopped */ 77#define PF_REMOTE 0x20 /* remote and flow controlled input */ 78#define PF_NOSTOP 0x40 79#define PF_UCNTL 0x80 /* user control mode */ 80 81void ptsstop __P((struct tty *, int)); --- 557 unchanged lines hidden (view full) --- 639 ttyflush(tp, FREAD|FWRITE); 640 return (0); 641 642#ifdef COMPAT_43 643 case TIOCSETP: 644 case TIOCSETN: 645#endif 646 case TIOCSETD: |
652 ndflush(&tp->t_outq, tp->t_outq.c_cc); 653 break; 654 | |
655 case TIOCSETA: 656 case TIOCSETAW: | 647 case TIOCSETA: 648 case TIOCSETAW: |
657 case TIOCSETAF: { 658 register struct termios *t = (struct termios *)data; 659 register int i; 660 661 for (i = MAX_SPEED; i >= 0; i--) 662 if (t->c_ispeed == validspeed[i]) 663 break; 664 else if (t->c_ispeed > validspeed[i]) 665 return (EINVAL); 666 if (i < 0) 667 return (EINVAL); 668 for (i = MAX_SPEED; i >= 0; i--) 669 if (t->c_ospeed == validspeed[i]) 670 break; 671 else if (t->c_ospeed > validspeed[i]) 672 return (EINVAL); 673 if (i < 0) 674 return (EINVAL); 675 | 649 case TIOCSETAF: |
676 ndflush(&tp->t_outq, tp->t_outq.c_cc); | 650 ndflush(&tp->t_outq, tp->t_outq.c_cc); |
677 } | |
678 break; 679 680 case TIOCSIG: 681 if (*(unsigned int *)data >= NSIG) 682 return(EINVAL); 683 if ((tp->t_lflag&NOFLSH) == 0) 684 ttyflush(tp, FREAD|FWRITE); 685 pgsignal(tp->t_pgrp, *(unsigned int *)data, 1); --- 63 unchanged lines hidden --- | 651 break; 652 653 case TIOCSIG: 654 if (*(unsigned int *)data >= NSIG) 655 return(EINVAL); 656 if ((tp->t_lflag&NOFLSH) == 0) 657 ttyflush(tp, FREAD|FWRITE); 658 pgsignal(tp->t_pgrp, *(unsigned int *)data, 1); --- 63 unchanged lines hidden --- |