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