From owner-freebsd-questions Mon Sep 20 15:41:43 1999 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 46EB115757 for ; Mon, 20 Sep 1999 15:41:40 -0700 (PDT) (envelope-from bright@wintelcom.net) Received: from localhost (bright@localhost) by fw.wintelcom.net (8.9.3/8.9.3) with ESMTP id PAA17632; Mon, 20 Sep 1999 15:57:01 -0700 (PDT) Date: Mon, 20 Sep 1999 15:57:01 -0700 (PDT) From: Alfred Perlstein To: "Oleg V. Volkov" Cc: freebsd-questions@FreeBSD.ORG Subject: Re: How to find absolute name of running binary? In-Reply-To: <19990921020955.C16138@fly.lglobus.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 21 Sep 1999, Oleg V. Volkov wrote: > Hi! > > Well subject says it all. How could i find absolute name of my running > binary from inside it? References to man or C examples welcome. > > Please CC: replys to me - i'm not on list. I think some permutation of getcwd(3) and argv[0] should help, perhaps with lstat (to check if you were run via a symlink) -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message