linux Signal Handling

來源:互聯網
上載者:User

A signal is a software interrupt delivered to a process. The operating system uses signals to report exceptional situations to an executing program. Some signals report errors such as references to invalid memory addresses; others report asynchronous events, such as disconnection of a phone line.

The GNU C library defines a variety of signal types, each for a particular kind of event. Some kinds of events make it inadvisable or impossible for the program to proceed as usual, and the corresponding signals normally abort the program. Other kinds of signals that report harmless events are ignored by default.

If you anticipate an event that causes signals, you can define a handler function and tell the operating system to run it when that particular type of signal arrives.

Finally, one process can send a signal to another process; this allows a parent process to abort a child, or two related processes to communicate and synchronize.

  • Concepts of Signals: Introduction to the signal facilities.
  • Standard Signals: Particular kinds of signals with standard names and meanings.
  • Signal Actions: Specifying what happens when a particular signal is delivered.
  • Defining Handlers: How to write a signal handler function.
  • Interrupted Primitives: Signal handlers affect use of open, read, write and other functions.
  • Generating Signals: How to send a signal to a process.
  • Blocking Signals: Making the system hold signals temporarily.
  • Waiting for a Signal: Suspending your program until a signal arrives.
  • Signal Stack: Using a Separate Signal Stack.
  • BSD Signal Handling: Additional functions for backward compatibility with BSD.
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.