Fix the issue "errno:EINTR,while it is suspended by msgrcv."
来源:互联网 发布:淘宝买东西扣银行卡吗 编辑:程序博客网 时间:2024/06/06 06:15
Fix the issue "errno:EINTR,while it is suspended by msgrcv."
If the calling process is blocked until one of the following conditions occurs:
1.A message of the desired type is placed in the queue.
2.The message queue specified by msqid is removed from the system
3.The calling process receives a signal that is to be caught.
If the calling process is suspended waiting for a message, the following conditions will cause msgrcv() to return an error and set errno to indicate the error condition.
1.The message queue specified by msqid is removed from the system
2.The calling process receives a signal that is to be caught.
How to fix this issue?
1. Just continue while msgrcv() in while circle.
while(1){
if(msgrcv(msg_id,(void *)&event,sizeof(SPRING_EVENT),msg2rec,0) == -1){
/*A process waited in msgrcv() was interrupted by a signal.*/
if(errno == EINTR){
sleep(1);
continue;
}
fprintf(stderr, "msgrcv failed with error: %d\n", errno);
exit(EXIT_FAILURE);
}
}
2. The other cases. go to maybe good choice.
come_on:
if(msgrcv(msg_id,(void *)&event,sizeof(SPRING_EVENT),msg2rec,0) == -1){
/*A process waited in msgrcv() was interrupted by a signal.*/
if(errno == EINTR){
sleep(1);
goto come_on;
}
fprintf(stderr, "msgrcv failed with error: %d\n", errno);
exit(EXIT_FAILURE);
}
Reference Link:
http://man-wiki.net/index.php/2:msgrcv
http://docs.hp.com/en/36430-90008/ch02s09.html
http://topic.csdn.net/t/20030323/18/1566458.html
If the calling process is blocked until one of the following conditions occurs:
1.A message of the desired type is placed in the queue.
2.The message queue specified by msqid is removed from the system
3.The calling process receives a signal that is to be caught.
If the calling process is suspended waiting for a message, the following conditions will cause msgrcv() to return an error and set errno to indicate the error condition.
1.The message queue specified by msqid is removed from the system
2.The calling process receives a signal that is to be caught.
How to fix this issue?
1. Just continue while msgrcv() in while circle.
while(1){
if(msgrcv(msg_id,(void *)&event,sizeof(SPRING_EVENT),msg2rec,0) == -1){
/*A process waited in msgrcv() was interrupted by a signal.*/
if(errno == EINTR){
sleep(1);
continue;
}
fprintf(stderr, "msgrcv failed with error: %d\n", errno);
exit(EXIT_FAILURE);
}
}
2. The other cases. go to maybe good choice.
come_on:
if(msgrcv(msg_id,(void *)&event,sizeof(SPRING_EVENT),msg2rec,0) == -1){
/*A process waited in msgrcv() was interrupted by a signal.*/
if(errno == EINTR){
sleep(1);
goto come_on;
}
fprintf(stderr, "msgrcv failed with error: %d\n", errno);
exit(EXIT_FAILURE);
}
Reference Link:
http://man-wiki.net/index.php/2:msgrcv
http://docs.hp.com/en/36430-90008/ch02s09.html
http://topic.csdn.net/t/20030323/18/1566458.html
- Fix the issue "errno:EINTR,while it is suspended by msgrcv."
- It is possible that this issue is resolved by uninstalling an existing version of the apk if it is
- It is possible that this issue is resolved by uninstalling an existing version of the apk if it is
- Issue 111( Most important discoveries or creation are accidental; it is usually while seeking the answer to one question that
- While it is not the end of a file, output file line by line
- How to fix the issue: An error occurred while validating. HRESULT = '80004005'
- 真机调试 it is possible that this issue is resolved by uninstalling
- INSTALL_FAILED_USER_RESTRICTED错误 It is possible that this issue is resolved by uninstalling an exis
- android studio编译提示it is possible that this issue is resolved by uninstalling an....
- errno!=EINTR
- 384. Strike the iron while it is hot. 趁热打铁
- 384. Strike the iron while it is hot. 趁热打铁
- Fix the issue: JVM terminated. Exit code=-1
- resolve the issue of "the machine is dead" caused by that /dev/ttyUSB2 cann't be opened
- cocoapods was not able to update the 'master' repo.if it is a unexpected issue and persists you can
- CocoaPods问题: CocoaPods was not able to update the `master` repo.if it is a unexpected issue and
- org.hibernate.cache.ReadWriteCache 抛出An item was expired by the cache while it was locked
- 解决小米手机Android Studio安装app 报错的问题It is possible that this issue is resolved by uninstalling an existi
- Qt静态编译以及Qt Creator环境搭建
- ARM、X86/Atom、MIPS、PowerPC
- 【xinfanqie】缓存文件目录修改方法一览
- Poj 1017 Packets(贪心策略)
- Apache URL重写的配置 及其 apache500错误
- Fix the issue "errno:EINTR,while it is suspended by msgrcv."
- 安卓基础开发
- FCL应用技巧之-----获取本机IP地址
- UVA 579 (13.07.20)
- Hibernate学习总结(1)
- jquery 遍历数组与数组详细说明
- xCAT裸机部署 ( by quqi99 )
- Java telnet连接的实现
- Hibernate学习总结(非常详细的总结,希望对初学者有帮助)