Roland Mainz wrote:
> Hi!
> 
> ----
> 
> Is there any "shortcut" to get the full path to the process's executable
> file ? Usually |readlink("/proc/self/path/a.out", buff, buffsize)| or
> |getexecname()| can be used - but is there any _faster_ way (e.g.
> something _not_ using a syscall (e.g. is this information somewhere
> above or below the |argv| array stored ?)) ?

Nope.

For most programs, this isn't an issue; they only call it once so
the time needed for getexecname() is trivial.

If you need to call this a lot, you should cache the returned value;
it's valid across fork and the cached value is destroyed on exec.

- Bart




-- 
Bart Smaalders                  Solaris Kernel Performance
barts at cyber.eng.sun.com              http://blogs.sun.com/barts
"You will contribute more with mercurial than with thunderbird."

Reply via email to