20:52 <josteink> twb: https://gist.github.com/josteink/18c7249e6e0d15053f6435b673ba5b08 20:52 <josteink> twb: feel free to send that to the debian guys
Also attached, title is/was "Getting your own process without using procfs on Linux".
// Shamelessly copied from Stack Overflow // http://stackoverflow.com/a/23621200 // // In the lack of a SYSCTL enum for process self-identification, // the following seems to work: #include <stdio.h> #include <sys/auxv.h> int main(int argc, char **argv) { printf("%s\n", (char *)getauxval(AT_EXECFN)); return(0); }
demo.sh
Description: Bourne shell script