1 /* Generic termios.h */
4 * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
7 * Redistribution and use in source and binary forms are permitted only
8 * as authorized by the OpenLDAP Public License. A copy of this
9 * license is available at http://www.OpenLDAP.org/license.html or
10 * in file LICENSE in the top-level directory of the distribution.
16 #ifdef HAVE_POSIX_TERMIOS
19 #ifdef GCWINSZ_IN_SYS_IOCTL
20 #include <sys/ioctl.h>
23 #define TERMIO_TYPE struct termios
24 #define TERMFLAG_TYPE tcflag_t
25 #define GETATTR( fd, tiop ) tcgetattr((fd), (tiop))
26 #define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop))
27 #define GETFLAGS( tio ) ((tio).c_lflag)
28 #define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags))
30 #elif defined( HAVE_SGTTY_H )
33 #ifdef HAVE_SYS_IOCTL_H
34 #include <sys/ioctl.h>
37 #define TERMIO_TYPE struct sgttyb
38 #define TERMFLAG_TYPE int
39 #define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop))
40 #define SETATTR( fd, tiop ) ioctl((fd), TIOCSETP, (caddr_t)(tiop))
41 #define GETFLAGS( tio ) ((tio).sg_flags)
42 #define SETFLAGS( tio, flags ) ((tio).sg_flags = (flags))
44 #endif /* HAVE_SGTTY_H */
46 #endif /* _AC_TERMIOS_H */