title: How to get the return value of a program ran via calling a member of the exec family of functions?
body: <p>I know that it is possible to read commands output with a pipe? But what about getting return value ? For example i want to execute:</p>
  
  <pre><code>execl("/bin/ping", "/bin/ping" , "-c", "1", "-t", "1", ip_addr, NULL);
  </code></pre>
  
  <p>How can i get returned value of ping command to find out if it returned 0 or 1?</p>