title: How to get the process name of a PID in FreeBSD?
body: <p>I am trying to write a function which returns the parent process name,<br>
  if it is <code>bash</code>, then it should return <code>bash</code>.</p>
  
  <pre><code>const std::string &amp;getParentProcessName() {
    static std::string name;
    auto ppid = getppid();
  #ifdef __FreeBSD__
    // ?????
  #else
   ...
  #endif
    name = "unknown";
    return name;
  }
  </code></pre>