Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
LINUX系統程式設計 第二版
by
Robert Love
December 2013
Intermediate to advanced
496 pages
8h 57m
Chinese
GoTop Information, Inc.
Content preview from
LINUX系統程式設計 第二版
386
|
第十章
以
payload
送出信號
正如我們在前一節所看到的,信號處理程序的註冊需要用到
SA_SIGINFO
旗標以及傳遞一
個
siginfo_t
參數。
siginfo_t
結構包含了一個名為
si_value
的欄位,這是一個可選用的
payload
(酬載)
3
,會從信號產生者遞送至信號接收者。
sigqueue()
函式(定義自
POSIX
)讓一個行程得以使用此
payload
來傳送信號:
#include <signal.h>
int sigqueue (pid_t pid,
int signo,
const union sigval value);
sigqueue()
的行為類似於
kill()
。執行成功時,
signo
所指定的信號會被排入
pid
所指定
之行程或行程群組的佇列,而且此函式會傳回
0
。此信號的
payload
由
value
來指定,
value
是一個整數與一個
void
指標所構成的
union
:
union sigval {
int sival_int;
void *sival_ptr;
};
執行失敗時,此呼叫會傳回
-1
並把
errno
設定為下面其中一個值:
EAGAIN
進行調用之行程能夠排入佇列的信號數目已達到限度。
EINVAL
signo
指定了無效的的信號。
EPERM
進行調用之行程的權限不足以將信號送往所要求的任何行程。傳送一個信號所要求
的權限如同
kill()
(見第
10
章〈傳送一個信號〉一節)。
ESRCH
pid
所指定的行程或行程群組不存在,或者是一個殭屍行程。
如同
kill()
,測試權限的方法就是將空字串( ...
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.
Start your free trial
You might also like
優雅的SciPy|Python科學研究的美學
Juan Nunez-Iglesias, Stéfan van der Walt, Harriet Dashnow
成為卓越程式設計師的38項必修法則
Pete Goodliffe
深入理解運算原理|從簡單的機器到無所不能的程式
Tom Stuart
C++语言导学(原书第2版)
本贾尼 斯特劳斯特鲁普
Publisher Resources
ISBN: 9789862769812