home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / posix / tcsetattr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-18  |  411 b   |  21 lines

  1. #include <termios.h>
  2. #include <errno.h>
  3. #include <sys/ioctl.h>
  4.  
  5.  
  6. int
  7. tcsetattr(int fildes, int optional_actions, struct termios *termios_p)
  8. {
  9.     switch(optional_actions) {
  10.         case TCSANOW:
  11.             return __ioctl(fildes, TCSETS, termios_p);
  12.         case TCSADRAIN:
  13.             return __ioctl(fildes, TCSETSW, termios_p);
  14.         case TCSAFLUSH:
  15.             return __ioctl(fildes, TCSETSF, termios_p);
  16.         default:
  17.             errno = EINVAL;
  18.             return -1;
  19.     }
  20. }
  21.