-# include <termio.h>
-# if !defined (TCOON)
-# define TCOON 1
-# endif
-# endif /* USG || hpux || Xenix || sgi || DUGX */
-#endif /* !_POSIX_VERSION */
-
-/* Posix systems use termios and the Posix signal functions. */
-#if defined (_POSIX_VERSION)
-# if !defined (TERMIOS_MISSING)
-# undef NEW_TTY_DRIVER
-# define TERMIOS_TTY_DRIVER
-# include <termios.h>
-# endif /* !TERMIOS_MISSING */
-# define HAVE_POSIX_SIGNALS
-# if !defined (O_NDELAY)
-# define O_NDELAY O_NONBLOCK /* Posix-style non-blocking i/o */
-# endif /* O_NDELAY */
-#endif /* _POSIX_VERSION */
-
-/* System V.3 machines have the old 4.1 BSD `reliable' signal interface. */
-#if !defined (HAVE_BSD_SIGNALS) && !defined (HAVE_POSIX_SIGNALS)
-# if defined (USGr3)
-# if !defined (HAVE_USG_SIGHOLD)
-# define HAVE_USG_SIGHOLD
-# endif /* !HAVE_USG_SIGHOLD */
-# endif /* USGr3 */
-#endif /* !HAVE_BSD_SIGNALS && !HAVE_POSIX_SIGNALS */
-
-/* Other (BSD) machines use sgtty. */
-#if defined (NEW_TTY_DRIVER)
-# include <sgtty.h>
-#endif
-
-/* Define _POSIX_VDISABLE if we are not using the `new' tty driver and
- it is not already defined. It is used both to determine if a
- special character is disabled and to disable certain special
- characters. Posix systems should set to 0, USG systems to -1. */
-#if !defined (NEW_TTY_DRIVER) && !defined (_POSIX_VDISABLE)
-# if defined (_POSIX_VERSION)
-# define _POSIX_VDISABLE 0
-# else /* !_POSIX_VERSION */
-# define _POSIX_VDISABLE -1
-# endif /* !_POSIX_VERSION */
-#endif /* !NEW_TTY_DRIVER && !_POSIX_VDISABLE */
-
-#if 1
-# define D_NAMLEN(d) strlen ((d)->d_name)
-#else /* !1 */
-
-#if !defined (SHELL) && (defined (_POSIX_VERSION) || defined (USGr3))
-# if !defined (HAVE_DIRENT_H)
-# define HAVE_DIRENT_H
-# endif /* !HAVE_DIRENT_H */
-#endif /* !SHELL && (_POSIX_VERSION || USGr3) */
-
-#if defined (HAVE_DIRENT_H)
-# include <dirent.h>
-# if !defined (direct)
-# define direct dirent
-# endif /* !direct */
-# define D_NAMLEN(d) strlen ((d)->d_name)
-#else /* !HAVE_DIRENT_H */
-# define D_NAMLEN(d) ((d)->d_namlen)
-# if defined (USG)
-# if defined (Xenix)
-# include <sys/ndir.h>
-# else /* !Xenix (but USG...) */
-# include "ndir.h"
-# endif /* !Xenix */
-# else /* !USG */
-# include <sys/dir.h>
-# endif /* !USG */
-#endif /* !HAVE_DIRENT_H */
-#endif /* !1 */
-
-#if defined (USG) && defined (TIOCGWINSZ) && !defined (Linux)
-# if defined (_AIX)
- /* AIX 4.x seems to reference struct uio within a prototype
- in stream.h, but doesn't cause the uio include file to
- be included. */
-# include <sys/uio.h>