1: #include "stdio.h"
   2: 
   3: makpipe()
   4: {
   5:     int f[2];
   6: 
   7:     pipe(f);
   8:     if (fork()==0) {
   9:         close(f[1]);
  10:         close(0);
  11:         dup(f[0]);
  12:         close(f[0]);
  13:         execl ("/bin/sh", "sh", "-i", 0);
  14:         execl ("/usr/bin/sh", "sh", "-i", 0);
  15:         write(2,"Exec error\n",11);
  16:     }
  17:     close(f[0]);
  18:     sleep(2);   /* so shell won't eat up too much input */
  19:     return(f[1]);
  20: }

Defined functions

makpipe defined in line 3; used 1 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 587
Valid CSS Valid XHTML 1.0 Strict