tcsetattr.c 223 B

123456789101112
  1. #include <termios.h>
  2. #include <sys/ioctl.h>
  3. #include <errno.h>
  4. int tcsetattr(int fd, int act, const struct termios *tio)
  5. {
  6. if (act < 0 || act > 2) {
  7. errno = EINVAL;
  8. return -1;
  9. }
  10. return ioctl(fd, TCSETS+act, tio);
  11. }