This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: getprogname / setprogname
"H. J. Lu" <hjl@lucon.org> wrote:
> On Fri, Mar 17, 2006 at 07:51:37AM -0800, Ulrich Drepper wrote:
>> H. J. Lu wrote:
>> > Since we are on this topic, sometimes, I want to know the real pathname
>> > of the program. It isn't easy to find it out.
>>
>> Of course it is: readlink() on /proc/self/exe.
>
> It doesn't work before /proc is mounted.
And, like every other symlink in /proc, /proc/self/exe is
invalid when the linked-to name is longer than PATH_MAX.