Gisle Aas <[EMAIL PROTECTED]> writes:

> On Solaris you can do something like this:
> 
> const char* find_exe() {
>     auxv_t auxv;
>     int fh;
>     int n;
> 
>     fh = open("/proc/self/auxv", O_RDONLY);
>     if (fh < 0)
>         return 0;
> 
>     while (1) {
>         n = read(fh, &auxv, sizeof(auxv));
>         if (n != sizeof(auxv))
>             break;
> 
>         if (auxv.a_type == AT_SUN_EXECNAME) {
>             close(fh);
>             return auxv.a_un.a_ptr;
>         }
>     }
>     close(fh);
>     return 0;
> }
> 
> Alan also told us that in this message:
> http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-05/msg00227.html

And this is Sarathy's perl code that does the same thing:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-05/msg00294.html

Reply via email to