title: How can I use a child's PID from a parent to shut down a pipe?
body: <p>I'm using c language in Linux.  <strong>I have set up code to create a bidirection pipe</strong> between a child process and a parent process. I'm able us the pipe for bidirectional communication.    However, I'm supposed to use the pid, process id, of the child process in order to send an EOF to the child process and thus close the pipe used to send input to the child process. This is supposed to be done <strong>with just the pid</strong>, from within the parent process. Do I have a way to do this?   I've been looking around and I haven't figured this out.</p>
  <p>I'm using the functions pipe(), fork(), execl(), etc. for this program.</p>
  <p>Additionally, it's for a command shell: execl(&quot;/bin/sh&quot;, &quot;sh&quot;, &quot;-c&quot;, command, NULL);</p>
  <p>This might be my clue.</p>
  <p>Thanks for any help!</p>
  <p>...John</p>