[BusyBox] vfork_daemon_rexec

Russ Dill Russ.Dill at asu.edu
Mon Nov 24 19:23:18 UTC 2003


On Mon, 2003-11-24 at 02:40, Vladimir N. Oleynik wrote:
> Russ,
> 
> > why does vfork_daemon_rexec contain:
> > execvp("/proc/self/exe", vfork_args);
> > /proc/self/exe does not work in uclinux
> 
> I have not uclinux and my idea with vfork_rexec is for dispute only.
> I geted this from msh busybox applet changes special for MMU-less.
> 
> > (btw, vfork_daemon_rexec doesn't work for me, it just says
> > f: applet not found)
> 
> Have your argv[0] valid name?

char **vfork_args;
int a = 0;

vfork_args = xcalloc(sizeof(char *), argc + 3);
while(*argv) {
    vfork_args[a++] = *argv;
    argv++;
}
vfork_args[a] = foreground_opt;
execvp("/proc/self/exe", vfork_args);
vfork_args[0] = "/bin/busybox";
execv(vfork_args[0], vfork_args);
bb_perror_msg_and_die("execv %s", vfork_args[0]);

argv[0] will always be /bin/busybox. argv[1] will probably be foreground
op. (execvp falls through since /proc/self/exe isn't implemented)

thus the command would be:

/bin/busybox -f

to which busybox responds:

f: applet not found

-- 
Russ Dill <Russ.Dill at asu.edu>




More information about the busybox mailing list