print to an other session's controlling terminal

78 views Asked by At

Why does echo hello > /dev/pts/xxx work (here xxx refers to another session's controlling terminal)?

With default setting, a process of the background process group of this session will get a signal SIGTTOU when it tries to write to stdout (here stdout refers to the controlling terminal), because the terminal driver will check whether this process belongs to the foreground process group.

So how does the terminal driver tolerate an output from another session's process? What happened there?

0

There are 0 answers