From owner-freebsd-questions Mon May 26 09:30:20 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA27084 for questions-outgoing; Mon, 26 May 1997 09:30:20 -0700 (PDT) Received: from precipice.shockwave.com (ppp-206-170-5-9.rdcy01.pacbell.net [206.170.5.9]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA27061 for ; Mon, 26 May 1997 09:30:13 -0700 (PDT) Received: from shockwave.com (localhost [127.0.0.1]) by precipice.shockwave.com (8.8.5/8.7.3) with ESMTP id JAA29924; Mon, 26 May 1997 09:29:40 -0700 (PDT) Message-Id: <199705261629.JAA29924@precipice.shockwave.com> To: dg@root.com cc: questions@FreeBSD.ORG Subject: Re: execve() and the actual name of the image executed In-reply-to: Your message of "Sat, 24 May 1997 17:53:05 PDT." <199705250053.RAA16879@implode.root.com> Date: Mon, 26 May 1997 09:29:40 -0700 From: Paul Traina Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Thanks David, that hit the spot. From: David Greenman Subject: Re: execve() and the actual name of the image executed >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//file is one way. This only works on FreeBSD 2.2+, however. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project