]> code.delx.au - gnu-emacs/blobdiff - src/systty.h
(syms_of_buffer): Doc fix.
[gnu-emacs] / src / systty.h
index b5d7c7b7cfad13e5a5587b33075a97af59b0b3e0..4b8c2262ea0a2b5079f340b37a401f9ba900aa0f 100644 (file)
@@ -63,12 +63,12 @@ Boston, MA 02111-1307, USA.  */
 #if defined(_AIX) && defined(_I386)
 #include <termios.h>           /* termios.h needs to be before termio.h */
 #include <termio.h>
-#else /* not HAVE_TERMIOS */
+#else /* not (_AIX && _I386) */
 #ifndef NO_TERMIO
 #include <termio.h>
 #endif
 #include <termios.h>
-#endif /* _AIX && _I386 */
+#endif /* not (_AIX && _I386) */
 #define INCLUDED_FCNTL
 #include <fcntl.h>
 #else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
@@ -116,6 +116,7 @@ static struct sensemode {
 #endif /* not HAVE_TERMIO */
 
 #ifdef __GNU_LIBRARY__
+#include <sys/ioctl.h>
 #include <termios.h>
 #endif
 
@@ -291,13 +292,26 @@ static struct sensemode {
 
 #endif
 
-/* EMACS_GETPGRP (arg) returns the process group of the terminal.  */
+/* EMACS_GETPGRP (arg) returns the process group of the process.  */
 
+#ifdef __GNU_LIBRARY__
+/* GNU libc by default defines getpgrp with no args on all systems.  */
+#if __GLIBC__  >= 2
+/* glibc-2.1 adds the BSD compatibility getpgrp function
+   if you use __BSD_SOURCE, which Emacs does on GNU/Linux systems.  */
+#if __GLIBC_MINOR__ < 1 || ! defined (_BSD_SOURCE)
+#define GETPGRP_NO_ARG
+#endif
+#else /* __GLIBC__ < 2 */
+#define GETPGRP_NO_ARG
+#endif /* __GLIBC__ < 2 */
+#else /* not __GNU_LIBRARY__ */
 #if defined (USG) && !defined (GETPGRP_NEEDS_ARG)
 #  if !defined (GETPGRP_NO_ARG)
 #    define GETPGRP_NO_ARG
 #  endif
 #endif
+#endif /* not __GNU_LIBRARY__ */
 
 #if defined (GETPGRP_NO_ARG)
 #  define EMACS_GETPGRP(x) getpgrp()