From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eli Zaretskii" To: dmj+@andrew.cmu.edu Cc: gdb-patches@sources.redhat.com Subject: Re: PATCH: Make gdbserver use async I/O on Linux Date: Thu, 07 Jun 2001 11:38:00 -0000 Message-id: <7458-Thu07Jun2001213544+0300-eliz@is.elta.co.il> References: <20010606140322.A29266@nevyn.them.org> <20010607104346.B19961@nevyn.them.org> X-SW-Source: 2001-06/msg00145.html > Date: Thu, 7 Jun 2001 10:43:46 -0700 > From: Daniel Jacobowitz > > 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!