Writing to child process file descriptor
-
07-11-2019 - |
質問
I have a program "Sample" which takes input both from stdin and a non-standard file descriptor (3 or 4) as shown below
int pfds[2];
pipe(pfds);
printf("%s","\nEnter input for stdin");
read(0, pO, 5);
printf("\nEnter input for fds 3");
read(pfds[0], pX, 5);
printf("\nOutput stout");
write(1, pO, strlen(pO));
printf("\nOutput fd 4");
write(pfds[1], pX, strlen(pX));
Now i have another program "Operator" which executes the above program(Sample) in a child process using execv. Now what i want is to send input to "Sample" through the "Operator" .
正しい解決策はありません
所属していません StackOverflow