close (0); dup (pdto[0]); close (1); dup (pdfrom[1]);
__close (0); __dup (pdto[0]); __close (1); __dup (pdfrom[1]);
_openchild (char *command, FILE ** fto, FILE ** ffrom){  int i;  int pid;  int pdto[2];  int pdfrom[2];  if (pipe (pdto) < 0)    goto error1;  if (pipe (pdfrom) < 0)    goto error2;  switch (pid = fork ())    {    case -1:      goto error3;    case 0:      /*       * child: read from pdto[0], write into pdfrom[1]       */      close (0);      dup (pdto[0]);      close (1);      dup (pdfrom[1]);      fflush (stderr);      for (i = _rpc_dtablesize () - 1; i >= 3; i--)	close (i);      fflush (stderr);      execlp (command, command, 0);      perror ("exec");      _exit (~0);    default:      /*       * parent: write into pdto[1], read from pdfrom[0]       */      *fto = fdopen (pdto[1], "w");      close (pdto[0]);      *ffrom = fdopen (pdfrom[0], "r");      close (pdfrom[1]);      break;    }  return pid;  /*   * error cleanup and return   */error3:  close (pdfrom[0]);  close (pdfrom[1]);error2:  close (pdto[0]);  close (pdto[1]);error1:  return -1;}