libast in the next release now has extern size_t pathprog(const char* default_command, char* path, size_t pathsize); in src/lib/libast/path/pathprog.c to abstract the path-to-current-executable across architectures
On Sat, 21 Feb 2009 15:17:34 +0100 Roland Mainz wrote: > Roland Mainz wrote: > > Casper.Dik at Sun.COM wrote: > [snip] > > > I also noticed that ksh93 tries to readlink("/proc/<pid>/exe"). In > > > Solaris, this can be found through "/proc/self/path/a.out" or > > > using getexecname(). > > > > Should we fix this now or with the ksh93-integration update2 putback ? > BTW: Linux has /proc/self/, too (which saves the |sprintf()| call) - but > we need a "iffe" probe to test for the exact location: > - Linux uses /proc/self/exe > - Solaris uses /proc/self/path/a.out > - FreeBSD/DragonFlyBSD uses /proc/curproc/file (per > http://www.gsp.com/cgi-bin/man.cgi?section=5&topic=procfs) > |getexecname()| may not be usefull since it returns a relative path and > not an abolute one and http://www.perlmonks.org/?node_id=686876 says > "... One ugly problem with getexecname on Solaris 8 is that it doesn't > make a distinction between an executable script and its associated > interpreter invoked via the shebang line ...". > ---- > Bye, > Roland > -- > __ . . __ > (o.\ \/ /.o) roland.mainz at nrubsig.org > \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer > /O /==\ O\ TEL +49 641 3992797 > (;O/ \/ \O;)