title: How to get the executable path on OpenBSD?
body: <p>I have tried:</p>
  
  <pre><code>char *path = realpath(getenv("_"), NULL);
  *(strrchr(path, '/')+1) = '\0';
  </code></pre>
  
  <p>That works, but if my executable is invoked by a parent process,
  then the path of the parent process is shown.</p>
  
  <p>I have googled a lot but I wasn't able to find any properly working solution.</p>
  
  <p><code>/proc</code> is no option.</p>