Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Sep 1999 15:57:01 -0700 (PDT)
From:      Alfred Perlstein <bright@wintelcom.net>
To:        "Oleg V. Volkov" <rover@lglobus.ru>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: How to find absolute name of running binary?
Message-ID:  <Pine.BSF.4.05.9909201556110.6368-100000@fw.wintelcom.net>
In-Reply-To: <19990921020955.C16138@fly.lglobus.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9909201556110.6368-100000>