Skip to Content
LINUX系統程式設計 第二版
book

LINUX系統程式設計 第二版

by Robert Love
December 2013
Intermediate to advanced
496 pages
8h 57m
Chinese
GoTop Information, Inc.
Content preview from LINUX系統程式設計 第二版
信號
|
357
數的映射取決於實作方式,而且不同的 Unix 系統會有所差異,雖然最前面的 12 個信號
通常採用相同的映射方式(例如,
SIGKILL
就是聲名狼籍之編號為 9 的信號)。一個好的
程式設計者總是會使用信號之可供人類閱讀的名稱,而絕對不會使用它的整數值。
信號的編號始於 1(通常就是
SIGHUP
),而且會繼續線性地向上成長。總共大約有 31
信號,但是多數程式只會固定使用其中幾個信號。沒有任何信號會使用值為
0
的編號,
這個特殊值就是所謂的
空信號
null signal
)。事實上,空信號並不是十分重要—它並不
會具有一個特殊的名稱—但是有些系統呼叫(例如
kill()
)會使用值為
0
的編號來代表
一種特殊情況。
你可以使用
kill -l
這道命令列出你的系統所支援的信號。
Linux 所支援的信號
10-1 列出了 Linux 所支援的信號。
10-1 信號列表
信號 說明 預定行為
SIGABRT 送出自
abort()
終止(terminate)並傾印
記憶體(core dump
SIGALRM 送出自
alarm()
終止
SIGBUS 硬體或對齊錯誤 終止並傾印記憶體
SIGCHLD 子行程已被終止 忽略
SIGCONT 行程中止後繼續執行 忽略
SIGFPE 算術例外事件 終止並傾印記憶體
SIGHUP 行程的控制終端機被關閉(最常見的情況是,用戶登出
系統)
終止
SIGILL 行程試圖執行一個非法指令 終止並傾印記憶體
SIGINT 用戶產生了中斷字符(Ctrl-C 終止
SIGIO 非同步
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

深入理解運算原理|從簡單的機器到無所不能的程式

深入理解運算原理|從簡單的機器到無所不能的程式

Tom Stuart
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey
算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow

Publisher Resources

ISBN: 9789862769812