Q. If a program running in the background tries to read from STDIN
β
Correct Answer: (A)
Its execution is suspended
Explanation: Background processes cannot read from the terminal. If they try, they are suspended by a SIGTTIN (teletype input) signal. The reason for this feature is that if multiple processes tried to read from the terminal, each character would essentially go randomly to one of the processes, which is not useful behavior. Thus, the foreground process gets the input and the background processes do not. If sudo tries to read from the terminal, to ask for your password, it is suspended. You must run sudo in the foreground, then switch to the background.