182498Sroberto/* 282498Sroberto * ntp_tty.h - header file for serial lines handling 382498Sroberto */ 482498Sroberto 582498Sroberto#ifndef NTP_TTY_H 682498Sroberto#define NTP_TTY_H 782498Sroberto 882498Sroberto#if defined(HAVE_BSD_TTYS) 982498Sroberto#include <sgtty.h> 1082498Sroberto#define TTY struct sgttyb 1182498Sroberto#endif /* HAVE_BSD_TTYS */ 1282498Sroberto 1382498Sroberto#if defined(HAVE_SYSV_TTYS) 1482498Sroberto#include <termio.h> 1582498Sroberto#define TTY struct termio 1682498Sroberto#ifndef tcsetattr 1782498Sroberto#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg) 1882498Sroberto#endif 1982498Sroberto#ifndef TCSANOW 2082498Sroberto#define TCSANOW TCSETA 2182498Sroberto#endif 2282498Sroberto#ifndef TCIFLUSH 2382498Sroberto#define TCIFLUSH 0 2482498Sroberto#endif 2582498Sroberto#ifndef TCOFLUSH 2682498Sroberto#define TCOFLUSH 1 2782498Sroberto#endif 2882498Sroberto#ifndef TCIOFLUSH 2982498Sroberto#define TCIOFLUSH 2 3082498Sroberto#endif 3182498Sroberto#ifndef tcflush 3282498Sroberto#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg) 3382498Sroberto#endif 3482498Sroberto#endif /* HAVE_SYSV_TTYS */ 3582498Sroberto 3682498Sroberto#if defined(HAVE_TERMIOS) 3782498Sroberto# ifdef TERMIOS_NEEDS__SVID3 3882498Sroberto# define _SVID3 3982498Sroberto# endif 4082498Sroberto# include <termios.h> 4182498Sroberto# ifdef TERMIOS_NEEDS__SVID3 4282498Sroberto# undef _SVID3 4382498Sroberto# endif 4482498Sroberto#define TTY struct termios 4582498Sroberto#endif 4682498Sroberto 4782498Sroberto#if defined(HAVE_SYS_MODEM_H) 4882498Sroberto#include <sys/modem.h> 4982498Sroberto#endif 5082498Sroberto 5182498Sroberto#if !defined(SYSV_TTYS) && !defined(STREAM) & !defined(BSD_TTYS) 5282498Sroberto#define BSD_TTYS 5382498Sroberto#endif /* SYSV_TTYS STREAM BSD_TTYS */ 5482498Sroberto 5582498Sroberto#endif /* NTP_TTY_H */ 56