title: How to pipe own output to another process?
body: <p>I want to do simple thing: <code>my_process | proc2 | proc3</code>, but programatically - without using shell, that can do this pretty easy. Is this possible? I cannot find anything :( </p>
  
  <p><strong>EDIT:</strong>
  Well, without code, nobody will know, what problem I'm trying to resolve. Actually, no output is going out (I'm using <code>printf</code>s)</p>
  
  <pre><code>int pip1[2];
  pipe(pip1);
  
  dup2(pip1[1], STDOUT_FILENO); 
  int fres = fork();
  
  if (fres == 0) {
      close(pip1[1]);
      dup2(pip1[0], STDIN_FILENO);
      execlp("wc", "wc", (char*)0);
  }
  else {
      close(pip1[0]);
  }
  </code></pre>