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