/contrib/ntp/include/ntp_tty.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 55 lines · 45 code · 7 blank · 3 comment · 1 complexity · e73a93c965f7832f73f4bbb5befe10a5 MD5 · raw file

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