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
> Date: Thu, 7 Jun 2001 10:43:46 -0700
> From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
>
> Easy enough. How about this, then?
>
> --
> Daniel Jacobowitz Debian GNU/Linux Developer
> Monta Vista Software Debian Security Team
>
> --ibTvN161/egqYuK8
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: attachment; filename="async2.diff"
>
> 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);
>
> --ibTvN161/egqYuK8--
>
Looks good to me. Thanks!