Add cfmakeraw. Like cf{get/set}{i/o}speed, it iisn't POSIx standard but is used
often enough and simple enough to write that we should allow it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42865 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -223,6 +223,7 @@ extern speed_t cfgetispeed(const struct termios *termios);
|
|||||||
extern speed_t cfgetospeed(const struct termios *termios);
|
extern speed_t cfgetospeed(const struct termios *termios);
|
||||||
extern int cfsetispeed(struct termios *termios, speed_t speed);
|
extern int cfsetispeed(struct termios *termios, speed_t speed);
|
||||||
extern int cfsetospeed(struct termios *termios, speed_t speed);
|
extern int cfsetospeed(struct termios *termios, speed_t speed);
|
||||||
|
extern void cfmakeraw(struct termios *termios);
|
||||||
extern int tcgetattr(int fd, struct termios *termios);
|
extern int tcgetattr(int fd, struct termios *termios);
|
||||||
extern int tcsetattr(int fd, int option, const struct termios *termios);
|
extern int tcsetattr(int fd, int option, const struct termios *termios);
|
||||||
extern int tcsendbreak(int fd, int duration);
|
extern int tcsendbreak(int fd, int duration);
|
||||||
|
|||||||
@@ -146,3 +146,15 @@ cfsetospeed(struct termios *termios, speed_t speed)
|
|||||||
termios->c_cflag |= speed;
|
termios->c_cflag |= speed;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
cfmakeraw(struct termios *termios)
|
||||||
|
{
|
||||||
|
termios->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR
|
||||||
|
| ICRNL | IXON);
|
||||||
|
termios->c_oflag &= ~OPOST;
|
||||||
|
termios->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
|
||||||
|
termios->c_cflag &= ~(CSIZE | PARENB);
|
||||||
|
termios->c_cflag |= CS8;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user