don't define this if _BSD_SOURCE is defined.
#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)