title: function to Get the terminal file descriptor of the current process UNIX
body: <p>I want to use function:</p>
  
  <pre><code>pid_t tcgetpgrp(int fildes);
  </code></pre>
  
  <p>How to retrieve the fildes(to be passed to this function).</p>
  
  <p>And is process group id returned by this function is same as the one returned by </p>
  
  <pre><code>getpgrp(0)//0 for the calling process
  </code></pre>
  
  <p>??</p>