diff options
Diffstat (limited to 'userspace/piper.c')
| -rw-r--r-- | userspace/piper.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/userspace/piper.c b/userspace/piper.c deleted file mode 100644 index 80cbd27..0000000 --- a/userspace/piper.c +++ /dev/null @@ -1,27 +0,0 @@ -#include <stdio.h> -#include "newcalls.h" - -extern **environ; - -int main() -{ - int fds[2]; - _pipe(fds); - - int pid=_fork(); - - if(pid) - { - _close(fds[1]); - _dup2(fds[0],0); // replace stdin with the read-end of pipe - char *args[]={"grep",NULL}; - _execve("/bin/grep",args,environ); - } - else - { - _close(fds[0]); - _dup2(fds[1],1); // replace stdout with the write-end of our pipe - char *args[]={"cat","hello.txt",0}; - _execve("/bin/cat",args,environ); - } -} |
