title: Execute sudo command in C with system()
body: <p>I am writing a piece of C code that will run some <code>sudo</code> command in <code>system("sudo ip route ...")</code> function call.</p>
  
  <p>This call is being done in a pthread created by the main thread, and the main program is being executed with <code>sudo ./program</code> when starting up.</p>
  
  <p>When I run the program, Ubuntu prompts me to enter password for nobody:</p>
  
  <p><code>[sudo] password for nobody:</code></p>
  
  <p>I also tried to do <code>system("ip route ...")</code> straightly but it gives me negative return meaning that it is not executed.</p>
  
  <p>What should I do in the thread to allow the <code>system()</code>call to use the <code>sudo</code> privilege inherited from the main program?</p>