I'm on a linux box and /proc/self/exe
does seem to be supported:
ls -l /proc/self/exe
shows that it's linked to/usr/bin/ls
at the moment I run the commandrealpath /proc/self/exe
prints out/usr/bin/realpath
as expected- both commands exit with status
0
But:
if (NULL == realpath("/proc/self/exe", NULL))
{
printf("this prints unexpectedly, %s\n", strerror(errno));
}
At this point, errno
is 22
and I see Invalid argument
. Why? Or -- how does one figure out why?