Process relationship control terminal

Source: Internet
Author: User

Sessions and Process Groups have some other features:

  • A session can have a control terminal (controlling terminal). This is usually logged on to itTerminal Device (in the case of terminal login) or Pseudo Terminal Device (in the case of network login)).
  • The first process of a session established to connect to the control terminal is called the controlling process).
  • Several process groups in a session can be dividedA foreground process group) AndOne or more background process groups).
  • If a session has a control terminal, it has a foreground process group, and other process groups in the session are background process groups..
  • Whenever you type the terminal's interrupt key (usually DELETE or Ctrl + C ),All processes sent from the interrupt signal to the foreground Process Group.
  • Whenever you type the terminal's return key (usually Ctrl + \),The exit signal is sent to all processes in the foreground process group..
  • If the terminal interface detects that the modem (or Network) is disconnectedSend the hanging signal to the control process (the first process of the session)).

These features are shown in Figure 9-7.

Sometimes, the program must be switched with the control terminal regardless of whether the standard input or standard output is redirected.To ensure that the program can read and write the control terminal, open the file/dev/tty. In the kernel, this special file is the definition of the control terminal.Naturally, if the program has no control terminal, opening the device will fail.

 

This blog is excerpted from advanced programming for UNIX environments (version 2) and used only for personal learning records. For more information about this book, see:Http://www.apuebook.com/.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.