Download - AOS Pr2

Transcript

14PGIT014AOSPractical 2Aim : Implement unnamed and named Pipe in C.Code : Unnamed pipe #include #include #include #include

int main(int argc, char **argv){char comm1[100], comm2[100], temp[100] ;char prefix[10] = "/bin/";char para1[10][100], para2[10][100], *pipesym = "PIPE";int first_comm, i=0, j=0,k=0, comm2_start, ret;

int fd[2], nbytes;pid_t childpid;char **args =malloc(sizeof(char*) * 20); char **args1 = malloc(sizeof(char*) * 20);strcpy(comm1,argv[1]); if (!argv[1] || argc