7 FreeBSD needs proc mounted for this function to work.
8 "mount -t procfs proc /proc"
11 const char* vm_executable_path(){
12 ssize_t bufsiz = 4096;
14 char* buf = new char [bufsiz + 1];
15 ssize_t size = readlink("/proc/curproc/file", buf, bufsiz);
17 fatal_error("Cannot read /proc/curproc/file", errno);
22 const char* ret = safe_strdup(buf);