Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C by agsha ( 16 years ago )
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>


int main (int argc, char* argv[]){

int fd[2];
int fd;
 mkfifo("k",0644);
 
 if(fork()==0){
 fd = open("k",O_WRONLY);
 dup2(fd[1],f);
 execlp("ls","ls",NULL);
 
 }
 else{
 fd = open("k",O_WRONLY);
 dup2(fd[0],f);
 execlp("wc","wc",NULL);
 unlink&#40;"k"&#41;;
 }


}

 

Revise this Paste

Parent: 14729
Children: 14731
Your Name: Code Language: