This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH: Make gdbserver use async I/O on Linux
On Thu, Jun 07, 2001 at 09:36:23AM +0300, Eli Zaretskii wrote:
>
> On Wed, 6 Jun 2001, Daniel Jacobowitz wrote:
>
> > The only problem I can think of that this might cause is if F_SETOWN is less
> > portable than FASYNC.
>
> Exactly. And that is why I'd suggest to make this change conditioned
> on F_SETOWN being defined.
Easy enough. How about this, then?
--
Daniel Jacobowitz Debian GNU/Linux Developer
Monta Vista Software Debian Security Team
Index: gdb/gdbserver/low-linux.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/low-linux.c,v
retrieving revision 1.9
diff -u -r1.9 low-linux.c
--- low-linux.c 2001/03/28 09:15:22 1.9
+++ low-linux.c 2001/06/07 17:37:52
@@ -105,7 +105,9 @@
int pid;
union wait w;
+ enable_async_io ();
pid = wait (&w);
+ disable_async_io ();
if (pid != inferior_pid)
perror_with_name ("wait");
Index: gdb/gdbserver/remote-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/remote-utils.c,v
retrieving revision 1.4
diff -u -r1.4 remote-utils.c
--- remote-utils.c 2001/03/06 08:21:44 1.4
+++ remote-utils.c 2001/06/07 17:37:52
@@ -156,6 +156,9 @@
#if defined(F_SETFL) && defined (FASYNC)
save_fcntl_flags = fcntl (remote_desc, F_GETFL, 0);
fcntl (remote_desc, F_SETFL, save_fcntl_flags | FASYNC);
+#if defined(F_SETOWN)
+ fcntl (remote_desc, F_SETOWN, getpid());
+#endif
disable_async_io ();
#endif /* FASYNC */
fprintf (stderr, "Remote debugging using %s\n", name);