title: Using getpeername with descriptor as 0
body: <p>I got an old code with this line:</p>
  
  <pre><code>getpeername(0, (struct sockaddr *)&amp;sin, &amp;namelen)
  </code></pre>
  
  <p>What does the <code>getpeername(0,...)</code> does?
  It works with all the OS?
  I tried to compile and run in the SUN and i get this => Socket operation on non-socket
  I did some research on the internet but i did't understood why i use this line, it returns my "localhost" ?</p>
  
  <p>Thanks</p>