4

For a process, what are the differences between a controlling terminal and non-controlling terminal?

If a process calls open() on a terminal's device file, will the terminal become the controlling terminal of the process' session?

Are the following different:

  • creating a connection between a process and a controlling terminal and

  • creating a connection between a process and a noncontrolling terminal

Are they both done by the process calling open() on the controlling/noncontrolling terminal's device file?

Related Does the master device appear just like a standard terminal to the driver program?

Tim
  • 101,790
  • Also related is https://unix.stackexchange.com/a/405780/5132 where back in 2017 I explained that it is actually sessions that are connected to controlling terminals. – JdeBP May 26 '18 at 22:43
  • Thanks. (1) "it is actually sessions that are connected to controlling terminals." If a session has a controlling terminal, does every process in the session has opened a file descriptor for the controlling terminal? (2) If a process has opened file descriptors for more than one terminals, how can we tell file descriptors which are for the controlling terminals of the process' session, from those which aref or noncontrolling terminals? – Tim May 28 '18 at 04:11
  • This is too broad a scope in my view. You have asked six questions in one, three of which are broad enough for individual full-length answers in their own rights. – JdeBP May 29 '18 at 10:25
  • Thanks. I am not very clear about what to separate out and what to keep here. I'd appreciate it if you could answer some relevant ones here. – Tim May 29 '18 at 11:53
  • @JdeBP See https://stackoverflow.com/questions/50649796/how-would-the-existing-processes-in-the-session-learn-about-and-acquire-the-cont and https://unix.stackexchange.com/questions/446738/when-a-session-leader-acquires-a-controlling-terminal-how-would-the-other-exist/446740 – Tim Jun 01 '18 at 19:54
  • Also https://stackoverflow.com/questions/50650251/how-can-we-tell-file-descriptrs-for-controlling-terminal-from-for-noncontrolling – Tim Jun 01 '18 at 19:56

0 Answers0