#ifdef HAVE_TERMIOS
#define HAVE_TCATTR
#endif
+
+/* If we defined these before and we are about to redefine them,
+ prevent alarming warnings. */
+#ifdef BSD_TERMIOS
+#undef NL0
+#undef NL1
+#undef CR0
+#undef CR1
+#undef CR2
+#undef CR3
+#undef TAB0
+#undef TAB1
+#undef TAB2
+#undef XTABS
+#undef BS0
+#undef BS1
+#undef FF0
+#undef FF1
+#undef ECHO
+#undef NOFLSH
+#undef TOSTOP
+#undef FLUSHO
+#undef PENDIN
+#endif
\f
/* Include the proper files. */
#ifdef HAVE_TERMIO
#ifdef __DGUX
#include <sys/ioctl.h>
#endif
+#ifndef NO_TERMIO
#include <termio.h>
+#endif /* not NO_TERMIO */
#include <fcntl.h>
#else
#ifdef HAVE_TERMIOS
+#if defined(_AIX) && defined(_I386)
+#include <termios.h> /* termios.h needs to be before termio.h */
+#include <termio.h>
+#else
+#ifndef NO_TERMIO
#include <termio.h>
+#endif
#include <termios.h>
+#endif /* _AIX && _I386 */
#include <fcntl.h>
#else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
#ifndef VMS
#ifdef AIX
#include <sys/pty.h>
#include <unistd.h>
+#define UNISTD_H_INCLUDED
#endif /* AIX */
+#ifdef IRIX4
+/* Get _getpty prototype */
+#include <unistd.h>
+#define UNISTD_H_INCLUDED
+#endif
+
+#if defined (POSIX) && !defined (UNISTD_H_INCLUDED) && defined (HAVE_UNISTD_H)
+#include <unistd.h>
+#define UNISTD_H_INCLUDED
+#endif
+
#ifdef SYSV_PTYS
#include <sys/types.h>
#include <sys/tty.h>
#undef ASYNC
#endif
-/* Interupt input is not used if there is no FIONREAD. */
+/* Interrupt input is not used if there is no FIONREAD. */
#ifndef FIONREAD
#undef SIGIO
#endif
/* On TERMIOS systems, the tcmumbleattr calls take care of these
parameters, and it's a bad idea to use them (on AIX, it makes the
- tty hang for a long time).
+ tty hang for a long time). */
#if defined (TIOCGLTC) && !defined (HAVE_TERMIOS)
#define HAVE_LTCHARS
#endif
#define CDISABLE _POSIX_VDISABLE
#else /* not _POSIX_VDISABLE */
#ifdef CDEL
+#undef CDISABLE
#define CDISABLE CDEL
#else /* not CDEL */
#define CDISABLE 255
#ifdef EMACS_HAVE_TTY_PGRP
-#ifdef HAVE_TERMIOS
+#if defined (HAVE_TERMIOS) && ! defined (BSD_TERMIOS)
#define EMACS_GET_TTY_PGRP(fd, pgid) (*(pgid) = tcgetpgrp ((fd)))
#define EMACS_SET_TTY_PGRP(fd, pgid) (tcsetpgrp ((fd), *(pgid)))
#endif
+/* EMACS_GETPGRP (arg) returns the process group of the terminal. */
+
+#if defined (USG) && !defined (GETPGRP_NEEDS_ARG)
+# if !defined (GETPGRP_NO_ARG)
+# define GETPGRP_NO_ARG
+# endif
+#endif
+
+#if defined (GETPGRP_NO_ARG)
+# define EMACS_GETPGRP(x) getpgrp()
+#else
+# define EMACS_GETPGRP(x) getpgrp(x)
+#endif /* !GETPGRP_NO_ARG */
\f
/* Manipulate a TTY's input/output processing parameters. */