Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct termios options;
- openpty(&_masterfd, &_slavefd, _dev, NULL, NULL);
- fcntl(_masterfd, F_SETFL, 0);
- tcgetattr(_masterfd, &_savedOptions);
- tcgetattr(_masterfd, &options);
- cfmakeraw(&options);
- options.c_cflag |= (CLOCAL | CREAD);
- if (tcsetattr(_masterfd, TCSANOW, &options) != 0) {
- fprintf(stderr, "Can't set up PTYn");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement