TIL you can get the path to the current executable with getauxval(AT_EXECFN) on Linux, no messing with /proc necessary. It's a separate block of memory filled by the kernel, not argv[0] or anything.
-
-
This Tweet is unavailable.
-
Replying to @__vlqc
AT_EXECFN is an absolute path, which is exactly why it's useful
1 reply 0 retweets 1 like -
This Tweet is unavailable.
-
Replying to @__vlqc @whitequark
Keep in mind that on Linux systems it's entirely possible to run a binary from a path that cannot be accessed from the root of the mount tree (any more). Chroot comes to mind. I'm sure there are others.
1 reply 0 retweets 0 likes -
This Tweet is unavailable.
Replying to @__vlqc @whitequark
That too, combined with fexecve. I think /proc/self/exe would still work in these cases.
6:13 AM - 10 Jan 2018
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.