title: How to capture the output of execvp() function in c?
body: <p>I'm using <code>execvp()</code> function in C. <br> My code: </p>
  
  <pre><code>pid_t pid = fork();
   if(pid &lt; 0)
              printf("Fork faild\n");
           else if(pid == 0)
           {
              // chirld process
           } 
           else
           {
              // parent process
              execvp(args[0],args) 
           }
  </code></pre>
  
  <p>with <code>args</code> variable is <code>"ls"</code>. My screen display particular file such as </p>
  
  <blockquote>
    <p>a.txt , b.c , c.pdf</p>
  </blockquote>
  
  <p>....etc.
  So.. Can this function return to a variable? 
  Such as: </p>
  
  <blockquote>
    <p>char str[MAX] = " a.txt b.c c.pdf ";</p>
  </blockquote>
  
  <p>Sorry my english is bad.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I need send result of <code>execvp()</code> function from server to client using <code>send()</code> , <code>recv()</code>. </p>