lkml.org 
[lkml]   [2006]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Feature request: exec self for NOMMU.
Date
On Wednesday 27 December 2006 22:03, Rob Landley wrote:
> On Wednesday 27 December 2006 1:35 pm, Denis Vlasenko wrote:
> > This solves chroot problem. How to find path-to-yourself reliably
> > (for one, without using /proc/self/exe) is not obvious to me.
>
> Been there, done that. Both my toybox and Firmware Linux projects do this.
> In FWL it's line 115 of this file:
> http://landley.net/hg/firmware?f=937346748ff4;file=sources/toys/gcc-uClibc.c
>
> It's essentially the logic of the command line "which" utility applied to
> argv[0]. If argv[0] has a relative or absolute path, then it's vs cwd (this
> has to happen when you first run the program, before you cd). If argv[0] has
> no path then look at $PATH.

Yes Rob, I know it can be done like this. But we don't want this.
In the tar example, we want :

'Run my own binary again, with parameters: "zcat" "a.tar.gz",
even if there is no [/usr][/local]/bin/zcat -> busybox link anywhere'

We do not want to _search for_ zcat. We want to reexec our own binary.
--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-12-28 03:51    [W:2.502 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site