title: How do I find the current machine's full hostname in C (hostname and domain information)?
body: <p>In a C project (POSIX), how do I get the fully qualified name for the current system?</p>
  
  <p>For example, I can get just the hostname of my machine by doing
  <code>gethostname()</code> from unistd.h. This might give me <code>machine3</code> in return, but I'm actually looking for <code>machine3.somedomain.com</code> for example.</p>
  
  <p>How do I go about getting this information? I do not want to use a call to system() to do this, if possible.</p>