Solaris equivalent for getauxval(AT_EXECFN)

Stephen Nelson-Smith sanelson at gmail.com
Thu Jan 3 10:14:34 CET 2019


The source of which is here
https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/ptools/pargs/pargs.c

So if you want to write your own, rather than use the built in, you
can see the implementation.

Hope that helps, and I haven't misunderstood what you're trying to do.

Happy New Year!

S.

On Thu, Jan 3, 2019 at 8:55 AM Stephen Nelson-Smith <sanelson at gmail.com> wrote:
>
> Unless I'm missing something, isn't this what /usr/proc/bin/pargs does?
>
> On Wed, Jan 2, 2019 at 11:55 PM Jeffrey Walton via users
> <users at lists.opencsw.org> wrote:
> >
> > Hi Everyone,
> >
> > I'm looking for a quick-and-dirty way to get argv[0] without the
> > worries of hardlink or execve tricks. Modern Linux/glibc provides
> > getauxval(AT_EXECFN).
> >
> > I performed a quick search for Solaris but I am not finding useful
> > results. I also made a quick grep of Solaris headers but got 0 results
> > because I am not sure what I am search for.
> >
> > Does Solaris have a rough equivalent to Linux/glibc
> > getauxval(AT_EXECFN)? if so, then what is it?
> >
> > Thanks and sorry for the extra noise.


More information about the users mailing list