1 /* Generic termios.h */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2017 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
23 #ifdef GCWINSZ_IN_SYS_IOCTL
24 #include <sys/ioctl.h>
27 #define TERMIO_TYPE struct termios
28 #define TERMFLAG_TYPE tcflag_t
29 #define GETATTR( fd, tiop ) tcgetattr((fd), (tiop))
30 #define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop))
31 #define GETFLAGS( tio ) ((tio).c_lflag)
32 #define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags))
34 #elif defined( HAVE_SGTTY_H )
37 #ifdef HAVE_SYS_IOCTL_H
38 #include <sys/ioctl.h>
41 #define TERMIO_TYPE struct sgttyb
42 #define TERMFLAG_TYPE int
43 #define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop))
44 #define SETATTR( fd, tiop ) ioctl((fd), TIOCSETP, (caddr_t)(tiop))
45 #define GETFLAGS( tio ) ((tio).sg_flags)
46 #define SETFLAGS( tio, flags ) ((tio).sg_flags = (flags))
48 #endif /* HAVE_SGTTY_H */
50 #endif /* _AC_TERMIOS_H */