A

Admin • 833K Points
Coach

Q. If a program running in the background tries to read from STDIN

  • (A) Its execution is suspended
  • (B) STDIN is made available to him
  • (C) It completes its task
  • (D) None of the above
  • Correct Answer - Option(A)
  • Views: 17
  • Filed under category Linux
  • Hashtags:

Explanation by: Admin

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.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.