Linked Questions

Popular Questions

get execution path without /proc mounted

Asked by At

I have a shared hosting provider who does not mount /proc for security reason. I want to execute a binary file written in GO which needs the path in which it was started. This is done by using readlink and virtual link /proc/self/exe (see source https://github.com/golang/go/blob/master/src/os/executable_procfs.go) But this link can't be found due to the fact, that /proc is not mounted.

Arg[0] is not possible because you can call the file via "./app".

Is there a nother option to get execution path? Thanks for any help!

Related Questions