From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69595 invoked by alias); 19 Jul 2019 17:52:55 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 69587 invoked by uid 89); 19 Jul 2019 17:52:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=H*RU:209.85.208.196, HX-Spam-Relays-External:209.85.208.196, HX-Languages-Length:1525 X-HELO: mail-lj1-f196.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=s232ZHVFDJ1QFJjKap9xrbsWWgz1CgKJ5aePff0d2Nc=; b=eetzWIJo/UFvt3F3Y0fcStPfkfQJQr5atoz5HSBJ2aHCDJjW5iEqCnL/ME+1daJBd2 PoKW8L7TUoWy/Scx2bh6h+pWI4xc9B31iEDQdnSuHT/rk7+m9JND91Lgme2mcQa+5uzS 4fAPaj2vs0w2W44p0uofepXc+nMZulTUQoi8uh1I0v3Ish4pGzB3GZjTebArXjn4BNT3 BLKPnlI67QIL5gAkgWxcpVP+jJqym3k6NINthJoTef7jfItQoI9A3otBd4GmIEAhGJMU NMuw9GVEJpztQd2pt+bN0U0xl6K5WkTA5ODLO4reUMuacVYJ8POh8Z3d35DM33ofQsYK BZTQ== MIME-Version: 1.0 References: <2d3359a195633b85e01f83bf536330d72f7bc8aa.1563321715.git.alistair.francis@wdc.com> <87o91tdy6r.fsf@oldenburg2.str.redhat.com> In-Reply-To: <87o91tdy6r.fsf@oldenburg2.str.redhat.com> From: Alistair Francis Date: Fri, 19 Jul 2019 17:52:00 -0000 Message-ID: Subject: Re: [RFC v3 03/23] sysdeps/wait: Use waitid if avaliable To: Florian Weimer Cc: Alistair Francis , GNU C Library , Arnd Bergmann , Adhemerval Zanella , Palmer Dabbelt , macro@wdc.com, Zong Li Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-07/txt/msg00457.txt.bz2 On Tue, Jul 16, 2019 at 10:31 PM Florian Weimer wrote: > > * Alistair Francis: > > > +#ifdef __NR_waitid > > I wonder if the condition should be > > #ifndef __NR_wait4 > > etc. That would make it less risky for the existing architectures. Seems fair, I have updated that. > > > + case CLD_DUMPED: > > + *stat_loc =3D 0x80; > > + case CLD_KILLED: > > + *stat_loc |=3D infop.si_status; > > + break; > > The kernel does this (in kernel/exit.c): > > status =3D (p->signal->flags & SIGNAL_GROUP_EXIT) > ? p->signal->group_exit_code : p->exit_code; > wo->wo_stat =3D status; > =E2=80=A6 > if (infop) { > if ((status & 0x7f) =3D=3D 0) { > infop->cause =3D CLD_EXITED; > infop->status =3D status >> 8; > } else { > infop->cause =3D (status & 0x80) ? CLD_DUMPED : C= LD_KILLED; > infop->status =3D status & 0x7f; > } > infop->pid =3D pid; > infop->uid =3D uid; > } > > Therefore, I wonder if you need to propagate the lower bits from > si_status for CLD_DUMPED, too. We are propagating the bits due to a fall through in the switch statement, I have added a comment to indicate that we are falling through. > > For wait/wait3/waitpid, you could probably use the implementations for > sysdeps/unix/bsd, layered on top of wait4. I'm not sure what you mean here. > > The patch also needs some formatting tweaks regarding the placement of > braces, and there are missing spaces before parentheses. Yep, I have tried to fixup all the formatting issues. Alistair > > Thanks, > Florian