Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/691b01b4-1b64-800b-992e-192d846b72fe
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====== 5. 信号(Signals) ====== * '''信号的概念''':操作系统发送给进程的通知,用于中断、终止进程或进行定时等(例如用户按下 Ctrl-C) 。 * '''发送信号''': * '''kill 命令''':默认发送 SIGTERM 信号,可以用来发送其他信号如 SIGINT 。SIGKILL 信号不能被捕捉或忽略 。 * '''alarm(seconds) 函数''':设置一个定时器,在指定时间后发送 SIGALRM 信号(闹钟信号) 。 * '''raise(signal) 函数''':让进程向自己发送信号 。 * '''捕捉信号(Signal Handling)''': * 使用 sigaction 机制注册'''信号处理器(handler)'''函数来处理接收到的信号 。 * 信号处理器函数必须接收一个 int 参数(信号编号) 。 * '''修改信号行为''': * SIG_DFL:将信号处理方式还原为默认行为 。 * SIG_IGN:让进程忽略某个信号 。 我本周学习了第十章内容,请根据这些知识点相关知识,对我进行苏格拉底式提问,一次一个问题
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)