This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Get rid of NEED_POSIX_SETPGID & SETPGRP_ARGS
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH] Get rid of NEED_POSIX_SETPGID & SETPGRP_ARGS
- From: Mark Kettenis <kettenis at science dot uva dot nl>
- Date: Mon, 23 Jul 2001 21:24:21 +0200 (MET DST)
Since nobody objected (and Andrew said it was a good move :-)), I
checked this in.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* configure.in (AC_CHECK_FUNCS): Add setpggrp.
(AC_FUNC_SETPGRP): Add.
* aclocal.m4, configure, config.in: Regenerated.
* inflow.c (gdb_setpgid): Get rid of NEED_POSIX_SETPGID and
SETPGRP_ARGS. Always use setpgid if it is available, fall back on
setpgrp if it isn't. Use SETPGRP_VOID (defined by autoconf) to
distinguish between the two setpgrp flavours.
* config/xm-sysv4.h, config/arm/xm-linux.h,
config/i386/xm-i386aix.h, config/i386/xm-sco.h,
config/i386/xm-linux.h, config/i386/xm-ptx.h,
config/m68k/xm-linux.h, config/powerpc/xm-linux.h,
config/sparc/xm-linux.h, config/sparc/xm-sun4sol2.h,
config/ia64/xm-linux.h (NEED_POSIX_SETPGID): Remove.
* config/rs6000/xm-rs6000.h (SETPGRP_ARGS): Remove.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.66
diff -u -r1.66 configure.in
--- configure.in 2001/07/12 13:48:45 1.66
+++ configure.in 2001/07/23 19:20:17
@@ -131,9 +131,10 @@
AC_C_CONST
-AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask)
+AC_CHECK_FUNCS(setpgid setpgrp sbrk sigaction isascii bzero bcopy btowc poll sigprocmask)
AC_FUNC_VFORK
AC_FUNC_ALLOCA
+AC_FUNC_SETPGRP
# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
# since sigsetjmp might only be defined as a macro.
Index: inflow.c
===================================================================
RCS file: /cvs/src/src/gdb/inflow.c,v
retrieving revision 1.11
diff -u -r1.11 inflow.c
--- inflow.c 2001/07/15 20:34:13 1.11
+++ inflow.c 2001/07/23 19:20:17
@@ -709,21 +709,24 @@
if (job_control)
{
-#if defined (NEED_POSIX_SETPGID) || (defined (HAVE_TERMIOS) && defined (HAVE_SETPGID))
- /* setpgid (0, 0) is supposed to work and mean the same thing as
- this, but on Ultrix 4.2A it fails with EPERM (and
+#if defined (HAVE_TERMIOS) || defined (TIOCGPGRP)
+#ifdef HAVE_SETPGID
+ /* The call setpgid (0, 0) is supposed to work and mean the same
+ thing as this, but on Ultrix 4.2A it fails with EPERM (and
setpgid (getpid (), getpid ()) succeeds). */
retval = setpgid (getpid (), getpid ());
#else
-#if defined (TIOCGPGRP)
-#if defined(USG) && !defined(SETPGRP_ARGS)
+#ifdef HAVE_SETPGRP
+#ifdef SETPGRP_VOID
retval = setpgrp ();
#else
retval = setpgrp (getpid (), getpid ());
-#endif /* USG */
-#endif /* TIOCGPGRP. */
-#endif /* NEED_POSIX_SETPGID */
+#endif
+#endif /* HAVE_SETPGRP */
+#endif /* HAVE_SETPGID */
+#endif /* defined (HAVE_TERMIOS) || defined (TIOCGPGRP) */
}
+
return retval;
}
Index: config/xm-sysv4.h
===================================================================
RCS file: /cvs/src/src/gdb/config/xm-sysv4.h,v
retrieving revision 1.3
diff -u -r1.3 xm-sysv4.h
--- config/xm-sysv4.h 2001/07/12 13:48:46 1.3
+++ config/xm-sysv4.h 2001/07/23 19:20:17
@@ -28,10 +28,6 @@
#define USG
-/* Use setpgid(0,0) to run inferior in a separate process group */
-
-#define NEED_POSIX_SETPGID
-
/* We have to include these files now, so that GDB will not make
competing definitions in defs.h. */
#include <limits.h>
Index: config/arm/xm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/xm-linux.h,v
retrieving revision 1.2
diff -u -r1.2 xm-linux.h
--- config/arm/xm-linux.h 2001/07/12 18:22:36 1.2
+++ config/arm/xm-linux.h 2001/07/23 19:20:17
@@ -27,8 +27,6 @@
to get the offset in the core file of the register values. */
#define KERNEL_U_ADDR 0x0
-#define NEED_POSIX_SETPGID
-
/* Need R_OK etc, but USG isn't defined. */
#include <unistd.h>
Index: config/i386/xm-i386aix.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/xm-i386aix.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 xm-i386aix.h
--- config/i386/xm-i386aix.h 1999/07/07 20:13:29 1.1.1.2
+++ config/i386/xm-i386aix.h 2001/07/23 19:20:17
@@ -29,6 +29,3 @@
#define HAVE_SGTTY
#include <limits.h>
-
-/* Use setpgid instead of setpgrp on AIX */
-#define NEED_POSIX_SETPGID
Index: config/i386/xm-i386sco.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/xm-i386sco.h,v
retrieving revision 1.2
diff -u -r1.2 xm-i386sco.h
--- config/i386/xm-i386sco.h 2001/03/06 08:21:29 1.2
+++ config/i386/xm-i386sco.h 2001/07/23 19:20:17
@@ -38,6 +38,3 @@
So we use dots instead. This item must be coordinated with G++. */
#undef CPLUS_MARKER
#define CPLUS_MARKER '.'
-
-/* Use setpgid instead of setpgrp on SCO */
-#define NEED_POSIX_SETPGID
Index: config/i386/xm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/xm-linux.h,v
retrieving revision 1.6
diff -u -r1.6 xm-linux.h
--- config/i386/xm-linux.h 2001/07/14 11:55:29 1.6
+++ config/i386/xm-linux.h 2001/07/23 19:20:17
@@ -26,8 +26,6 @@
#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
-#define NEED_POSIX_SETPGID
-
/* Need R_OK etc, but USG isn't defined. */
#include <unistd.h>
Index: config/i386/xm-ptx.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/xm-ptx.h,v
retrieving revision 1.2
diff -u -r1.2 xm-ptx.h
--- config/i386/xm-ptx.h 2001/03/06 08:21:29 1.2
+++ config/i386/xm-ptx.h 2001/07/23 19:20:17
@@ -35,8 +35,6 @@
#define HAVE_TERMIOS
#define USG
-#define NEED_POSIX_SETPGID
-
#define USE_O_NOCTTY
#define HOST_BYTE_ORDER LITTLE_ENDIAN
Index: config/m68k/xm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/m68k/xm-linux.h,v
retrieving revision 1.4
diff -u -r1.4 xm-linux.h
--- config/m68k/xm-linux.h 2001/07/12 18:22:36 1.4
+++ config/m68k/xm-linux.h 2001/07/23 19:20:17
@@ -29,8 +29,6 @@
to get the offset in the core file of the register values. */
#define KERNEL_U_ADDR 0x0
-#define NEED_POSIX_SETPGID
-
/* Need R_OK etc, but USG isn't defined. */
#include <unistd.h>
Index: config/powerpc/xm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/powerpc/xm-linux.h,v
retrieving revision 1.5
diff -u -r1.5 xm-linux.h
--- config/powerpc/xm-linux.h 2001/07/12 18:22:36 1.5
+++ config/powerpc/xm-linux.h 2001/07/23 19:20:17
@@ -27,8 +27,6 @@
to get the offset in the core file of the register values. */
#define KERNEL_U_ADDR 0x0
-#define NEED_POSIX_SETPGID
-
/* Need R_OK etc, but USG isn't defined. */
#include <unistd.h>
Index: config/sparc/xm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/xm-linux.h,v
retrieving revision 1.2
diff -u -r1.2 xm-linux.h
--- config/sparc/xm-linux.h 2001/07/12 18:22:37 1.2
+++ config/sparc/xm-linux.h 2001/07/23 19:20:17
@@ -30,8 +30,6 @@
#define U_REGS_OFFSET 0
-#define NEED_POSIX_SETPGID
-
/* Need R_OK etc, but USG isn't defined. */
#include <unistd.h>
Index: config/sparc/xm-sun4sol2.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/xm-sun4sol2.h,v
retrieving revision 1.4
diff -u -r1.4 xm-sun4sol2.h
--- config/sparc/xm-sun4sol2.h 2001/03/06 08:21:37 1.4
+++ config/sparc/xm-sun4sol2.h 2001/07/23 19:20:17
@@ -31,9 +31,6 @@
#undef DO_DEFERRED_STORES
#undef CLEAR_DEFERRED_STORES
-/* May be needed, may be not? From Pace Willisson's port. FIXME. */
-#define NEED_POSIX_SETPGID
-
/* solaris doesn't have siginterrupt, though it has sigaction; however,
in this case siginterrupt would just be setting the default. */
#define NO_SIGINTERRUPT
Index: config/ia64/xm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/ia64/xm-linux.h,v
retrieving revision 1.3
diff -u -r1.3 xm-linux.h
--- config/ia64/xm-linux.h 2001/07/12 18:22:36 1.3
+++ config/ia64/xm-linux.h 2001/07/23 19:20:17
@@ -27,8 +27,6 @@
to get the offset in the core file of the register values. */
#define KERNEL_U_ADDR 0x0
-#define NEED_POSIX_SETPGID
-
/* Need R_OK etc, but USG isn't defined. */
#include <unistd.h>
Index: config/rs6000/xm-rs6000.h
===================================================================
RCS file: /cvs/src/src/gdb/config/rs6000/xm-rs6000.h,v
retrieving revision 1.4
diff -u -r1.4 xm-rs6000.h
--- config/rs6000/xm-rs6000.h 2001/03/06 08:21:35 1.4
+++ config/rs6000/xm-rs6000.h 2001/07/23 19:20:17
@@ -64,10 +64,6 @@
#define vfork fork
-/* Setpgrp() takes arguments, unlike ordinary Sys V's. */
-
-#define SETPGRP_ARGS 1
-
/* Signal handler for SIGWINCH `window size changed'. */
#define SIGWINCH_HANDLER aix_resizewindow