This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Fix internal error in wait_lwp (interrupted system call)
- From: Ulrich Weigand <uweigand at de dot ibm dot com>
- To: drow at false dot org (Daniel Jacobowitz)
- Cc: uweigand at de dot ibm dot com (Ulrich Weigand), gdb-patches at sources dot redhat dot com
- Date: Thu, 12 May 2005 23:02:55 +0200 (CEST)
- Subject: Re: [RFA] Fix internal error in wait_lwp (interrupted system call)
Daniel Jacobowitz wrote:
> On the one hand, this is very clever. On the other hand, it's not very
> robust. This is not the only signal that could arrive. Shouldn't
> wait_lwp be looping on EINTR anyway, probably by using my_waitpid
> (which is a recent addition)?
Well, this isn't very robust either as waitpid isn't the only system
call that could be interrupted -- it just typically has the biggest
race window as it tends to sleep ...
Using SA_RESTART has the advantage that it handles *all* (well,
nearly all) system calls automatically, without having to add
EINTR loops all over the place.
If other signals are in fact a problem, too, I'd rather install
them with SA_RESTART too. (However, I haven't ever seen the
problem with any other signal.)
Bye,
Ulrich
--
Dr. Ulrich Weigand
Linux on zSeries Development
Ulrich.Weigand@de.ibm.com