Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 68373a0c502c751d15e1fa61cfb3e7193328fff5
Ticket: 1224888fffffffffffffffffffffffffffffffff
possible to have an empty info nameofexecutable
User & Date: dkf on 2011-10-13 17:54:23
Changes

  1. icomment:
    I also like the dladdr() solution, though the name it yields is not necessarily normalized. Still, that's a practical solution (and would be easy to check for with autoconf).
    
    My little test code:
    
    #include <dlfcn.h>
    #include <stdio.h>
    int main(int argc,char**argv) {
      Dl_info info;
      if (!dladdr(main,&info)) {
        printf("not found\n");
        return 1;
      }
      printf("\"%s\"\n",info.dli_fname);
      return 0;
    }
    
    
  2. login: "dkf"
  3. mimetype: "text/plain"
  4. username: "dkf"