pipe 2 linux commands in C
The only other way that I could see this can be done in POSIX would be to use popen() rather than using raw pipes.  It also returns a stream pointer that can be used with the C standard I/O functions like fprintf(), fgets(), etc. to read and/or write to the process on the other-side of the pipe created by popen().  According to the POSIX specification, with popen(), 


  The environment of the executed
  command shall be as if a child process
  were created within the popen() call
  using the fork() function, and the
  child invoked the sh utility using the
  call:
  
  execl(shell path, "sh", "-c", command,
  (char *)0);
  
  where shell path is an unspecified
  pathname for the sh utility.


So it's basically an easier, more straight-forward way to work with pipes rather than having to fork child processes yourself and close the un-used portions of the pipe so that you don't end up with accidental blocking reads or lost writes because there are still active file-descriptors on each end of the pipe that you've accidentally forgotten to close in either the parent or child process.

With your example, using popen() would look like the following:

#include &lt;stdio.h&gt;
#define BUFFERSIZE 128

FILE *ls_proc, *grep_proc;
ls_proc = popen("ls -l", "r");
grep_proc = popen("grep .bashrc", "w");

char buffer[BUFFERSIZE];

//read from one child process and write to the other
while (fgets(buffer, BUFFERSIZE, ls_proc) != NULL)
    fprintf(grep_proc, "%s", buffer);

pclose(ls_proc);
pclose(grep_proc);