[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [BusyBox] Boggling at tar.c a bit...
From: mjn3 () codepoet ! org (Manuel Novoa III)
Date: 2005-08-26 14:35:20
Message-ID: 20050826143520.GA20611 () codepoet ! org
[Download RAW message or body]
On Thu, Aug 25, 2005 at 11:39:59PM -0500, Rob Landley wrote:
> What does the #ifdef __gnuc__ bit do?
Looks like it wraps some code to try to prevent gcc from throwing
warnings about unused vars.
> We have a volatile local variable (vfork_exec_errno), which is interacting
> with vfork in a way that seems unnecessarily subtle. (Do parent and child
> really reliably share a stack there? Why did the threading people need
> kernel support for thread local storage then?)
Of course they share a stack... the code is using vfork. Apparently
they wanted the child code to pass back the errno value to the parent
on failure. Since vfork_exec_errno is modified by the child in the 'if'
block and checked by the parent in the 'else' block, it needs to be
qualified as volatile.
Manuel
_______________________________________________
busybox mailing list
busybox@mail.busybox.net
http://codepoet.org/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic