title: What is the best method to ping in c++ under linux?
body: <p>I have to call ping from c++ code.I'd like to easily read the output for further utilizations.</p>
  
  <p>I have come up with two solutions:</p>
  
  <ul>
  <li>use a fork and a pipe, redirect ping output to the pipe and then parse it</li>
  <li>find a library suited for the purpose to use a ping(ip_addresss) function directly</li>
  </ul>
  
  <p>I'd like the latter but i didn't find anything that was clearly a standard solution.</p>
  
  <p>How would you do it ?</p>