The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-14-2008
shamrock shamrock is offline
Registered User
 

Join Date: Oct 2007
Location: USA
Posts: 500
Re-direct STDIN

Before reading data on the second pipe the parent process needs to redirect its standard input to fd2[0].

Code:
dup2(fd2[0], STDIN_FILENO);
Reply With Quote