Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 May 1997 16:01:22 -0700
From:      Paul Traina <pst@shockwave.com>
To:        questions@freebsd.org
Subject:   execve() and the actual name of the image executed
Message-ID:  <199705242301.QAA19073@precipice.shockwave.com>

next in thread | raw e-mail | index | archive | help
The parameters passed to execve include the filename that you wish
to exec, followed by the argv and envp structures.  A quick perusal
of kern_exec.s shows the kernel copying the argv and envp structures
to the new process area,  but it appears as if the path to the
executable is lost.

Is there any /absolutely guaranteed/ way to get a pointer to the/a path
that was actually used to invoke an image from that image?

Why?  I'm writing a piece of code where I want to fork/re-exec the
image that I'm currently running (or to be more exact, I want to fork/exec
an image located at the same place as the one I'm currently running was
when I started it).

Is this possible?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705242301.QAA19073>