The Linux Programming Interface: a linux and unix system Programming Handbook



tải về 6.93 Mb.
Chế độ xem pdf
trang18/806
Chuyển đổi dữ liệu08.07.2022
Kích6.93 Mb.
#52607
1   ...   14   15   16   17   18   19   20   21   ...   806
The Linux Programming Interface

21
SIGNALS: SIGNAL HANDLERS
 421
21.1
Designing Signal Handlers ......................................................................................... 422
21.1.1
Signals Are Not Queued (Revisited) ........................................................ 422
21.1.2
Reentrant and Async-Signal-Safe Functions ............................................... 422
21.1.3
Global Variables and the 
sig_atomic_t
Data Type ..................................... 428
21.2
Other Methods of Terminating a Signal Handler ........................................................... 428
21.2.1
Performing a Nonlocal Goto from a Signal Handler.................................. 429
21.2.2
Terminating a Process Abnormally: 
abort()
............................................... 433
21.3
Handling a Signal on an Alternate Stack: 
sigaltstack()
................................................... 434
21.4
The SA_SIGINFO Flag................................................................................................... 437
21.5
Interruption and Restarting of System Calls ................................................................... 442
21.6
Summary.................................................................................................................. 445
21.7
Exercise ................................................................................................................... 446
22
SIGNALS: ADVANCED FEATURES
 447
22.1
Core Dump Files ....................................................................................................... 448
22.2
Special Cases for Delivery, Disposition, and Handling ................................................... 450
22.3
Interruptible and Uninterruptible Process Sleep States..................................................... 451
22.4
Hardware-Generated Signals...................................................................................... 452
22.5
Synchronous and Asynchronous Signal Generation ....................................................... 452


Contents in Detail
xvii
22.6
Timing and Order of Signal Delivery ........................................................................... 453
22.7
Implementation and Portability of 
signal()
..................................................................... 454
22.8
Realtime Signals........................................................................................................ 456
22.8.1
Sending Realtime Signals....................................................................... 458
22.8.2
Handling Realtime Signals ..................................................................... 460
22.9
Waiting for a Signal Using a Mask: 
sigsuspend()
.......................................................... 464
22.10 Synchronously Waiting for a Signal............................................................................. 468
22.11 Fetching Signals via a File Descriptor........................................................................... 471
22.12 Interprocess Communication with Signals ..................................................................... 474
22.13 Earlier Signal APIs (System V and BSD) ........................................................................ 475
22.14 Summary.................................................................................................................. 477
22.15 Exercises .................................................................................................................. 478

tải về 6.93 Mb.

Chia sẻ với bạn bè của bạn:
1   ...   14   15   16   17   18   19   20   21   ...   806




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương