I have one parent process which forks another process through system function. In the parent process I am using /dev/null as STDIN. I want to change the STDIN to tty before forking the child process. How to change the STDIN to tty ?. The forked child process should use the tty as STDIN and the parent should use /dev/null as STDIN
open(STDIN,"/dev/null");
#do some ops
#Change STDIN back to tty
system("child process");
open(STDIN,"/dev/null");