Lines Matching refs:termios_p
42 cfgetospeed(struct termios *termios_p)
44 return (termios_p->c_cflag & CBAUDEXT ?
45 (termios_p->c_cflag & CBAUD) + CBAUD + 1 :
46 termios_p->c_cflag & CBAUD);
53 cfsetospeed(struct termios *termios_p, speed_t speed)
60 termios_p->c_cflag |= CBAUDEXT;
63 termios_p->c_cflag &= ~CBAUDEXT;
65 termios_p->c_cflag =
66 (termios_p->c_cflag & ~CBAUD) | (speed & CBAUD);
74 cfgetispeed(struct termios *termios_p)
76 return (termios_p->c_cflag & CIBAUDEXT ?
77 ((termios_p->c_cflag & CIBAUD) >> IBSHIFT)
79 (termios_p->c_cflag & CIBAUD) >> IBSHIFT);
86 cfsetispeed(struct termios *termios_p, speed_t speed)
93 termios_p->c_cflag |= CIBAUDEXT;
96 termios_p->c_cflag &= ~CIBAUDEXT;
97 termios_p->c_cflag =
98 (termios_p->c_cflag & ~CIBAUD) | ((speed << IBSHIFT) & CIBAUD);
106 tcgetattr(int fd, struct termios *termios_p)
108 return (ioctl(fd, TCGETS, termios_p));
115 tcsetattr(int fd, int option, struct termios *termios_p)
120 if ((((termios_p->c_cflag >> IBSHIFT) & CIBAUD) == 0) &&
121 ((termios_p->c_cflag & CIBAUDEXT) == 0)) {
122 work_area = *termios_p;
124 if (termios_p->c_cflag & CBAUDEXT)
126 termios_p = &work_area;
130 return (ioctl(fd, TCSETSW, termios_p));
132 return (ioctl(fd, TCSETSF, termios_p));
134 return (ioctl(fd, TCSETS, termios_p));