title: How can I add a new argument to the existing variable argument list?
body: <p>In a multi-threaded program I'm writing a custom print function which accepts a variable argument list.</p>
  
  <pre><code>void t_printf(char * str, ...)
  {
      if(file_ptr != NULL)
      {
              va_list ap;
              va_start(ap, str);
  
              vfprintf(file_ptr, str, ap);
  
              va_end(ap);
  
              fflush(file_ptr);
      }
  }
  </code></pre>
  
  <p>Inside this function I want to add the <em>current thread id</em> (using <code>pthread_self()</code>) to the message getting printed. How can I do it? Is there a way to add it to the existing va_list?</p>