Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 May 1997 17:53:05 -0700
From:      David Greenman <dg@root.com>
To:        Paul Traina <pst@shockwave.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: execve() and the actual name of the image executed 
Message-ID:  <199705250053.RAA16879@implode.root.com>
In-Reply-To: Your message of "Sat, 24 May 1997 16:01:22 PDT." <199705242301.QAA19073@precipice.shockwave.com> 

next in thread | previous 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.

   Yup.

>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?

   /proc/<pid>/file is one way. This only works on FreeBSD 2.2+, however.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project



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