1 /* Generic termios.h */
6 #ifdef HAVE_POSIX_TERMIOS
9 #ifdef GCWINSZ_IN_SYS_IOCTL
10 #include <sys/ioctl.h>
13 #define TERMIO_TYPE struct termios
14 #define TERMFLAG_TYPE tcflag_t
15 #define GETATTR( fd, tiop ) tcgetattr((fd), (tiop))
16 #define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop))
17 #define GETFLAGS( tio ) ((tio).c_lflag)
18 #define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags))
20 #elif defined( HAVE_SGTTY_H )
23 #ifdef HAVE_SYS_IOCTL_H
24 #include <sys/ioctl.h>
27 #define TERMIO_TYPE struct sgttyb
28 #define TERMFLAG_TYPE int
29 #define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop))
30 #define SETATTR( fd, tiop ) ioctl((fd), TIOCSETP, (caddr_t)(tiop))
31 #define GETFLAGS( tio ) ((tio).sg_flags)
32 #define SETFLAGS( tio, flags ) ((tio).sg_flags = (flags))
34 #endif /* HAVE_SGTTY_H */
36 #endif /* _AC_TERMIOS_H */