由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - async-signal safe 问题
相关主题
file descriptorwhich shell is the best among csh, ksh, bsh?
[转载] alarm, pause 又一问pthread_kill SIGINT SIG_DFL multithread
Does Linux support thread?Perl Q
A Unix questionSocket programming help
what is the difference between pthread and thr_ ?a perl question
does Linux has real time timer?多次遇到这种问题:previous declaration of .....
multithread questionCan I get the CPU-time of a thread?
X Window求助[转载] 写程序 通讯 的 API (IPC )
相关话题的讨论汇总
话题: signal话题: async话题: safe话题: malloc话题: handler
进入Unix版参与讨论
1 (共1页)
g****o
发帖数: 1284
1
由于malloc()不是async-signal-safe的, 所以不能在signal handler里使用它. 但如果
在malloc()里用sigmask把所有信号都屏蔽掉, 也就是说它不会受到信号的干扰, 那是不
是就可以在singal handler里调用malloc了呢? 盼各位大侠赐教!
o***z
发帖数: 133
2
if it's known that the signal didn't happen inside a POSIX function,
then it should be safe to call arbitrary POSIX functions inside a handler.

【在 g****o 的大作中提到】
: 由于malloc()不是async-signal-safe的, 所以不能在signal handler里使用它. 但如果
: 在malloc()里用sigmask把所有信号都屏蔽掉, 也就是说它不会受到信号的干扰, 那是不
: 是就可以在singal handler里调用malloc了呢? 盼各位大侠赐教!

1 (共1页)
进入Unix版参与讨论
相关主题
[转载] 写程序 通讯 的 API (IPC )what is the difference between pthread and thr_ ?
[转载] Unix/Posix system programming trainingdoes Linux has real time timer?
how to check disk available using posix API?multithread question
Semaphores in Linux (转载)X Window求助
file descriptorwhich shell is the best among csh, ksh, bsh?
[转载] alarm, pause 又一问pthread_kill SIGINT SIG_DFL multithread
Does Linux support thread?Perl Q
A Unix questionSocket programming help
相关话题的讨论汇总
话题: signal话题: async话题: safe话题: malloc话题: handler