1/*	$NetBSD$	*/
2
3/*
4 * ntp_tty.h - header file for serial lines handling
5 */
6
7#ifndef NTP_TTY_H
8#define NTP_TTY_H
9
10#if defined(HAVE_BSD_TTYS)
11#include <sgtty.h>
12#define TTY	struct sgttyb
13#endif /* HAVE_BSD_TTYS */
14
15#if defined(HAVE_SYSV_TTYS)
16#include <termio.h>
17#define TTY	struct termio
18#ifndef tcsetattr
19#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
20#endif
21#ifndef TCSANOW
22#define TCSANOW	TCSETA
23#endif
24#ifndef TCIFLUSH
25#define TCIFLUSH 0
26#endif
27#ifndef TCOFLUSH
28#define TCOFLUSH 1
29#endif
30#ifndef TCIOFLUSH
31#define TCIOFLUSH 2
32#endif
33#ifndef tcflush
34#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
35#endif
36#endif /* HAVE_SYSV_TTYS */
37
38#if defined(HAVE_TERMIOS)
39# ifdef TERMIOS_NEEDS__SVID3
40#  define _SVID3
41# endif
42# include <termios.h>
43# ifdef TERMIOS_NEEDS__SVID3
44#  undef _SVID3
45# endif
46#define TTY	struct termios
47#endif
48
49#if defined(HAVE_SYS_MODEM_H)
50#include <sys/modem.h>
51#endif
52
53#if !defined(SYSV_TTYS) && !defined(STREAM) & !defined(BSD_TTYS)
54#define BSD_TTYS
55#endif /* SYSV_TTYS STREAM BSD_TTYS */
56
57#endif /* NTP_TTY_H */
58