Question

I am trying to write two strings 'username' and 'passwd' into my child process as stdin, and run 'checker' to varify the username/passwd combo and return a value back to the parent process. Somehow my code doesn't work because "the checker program could not read from stdin" How should I fix this?

pid_t pid;
int status;
int fd[2];

pid = fork(); 
if ((pipe(fd)) ==-1){
    perror("pipe");
    exit(1);
}

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top