linux - 程序接收信号SIGIO

标签 linux nginx signals

我在 Nginx 的 error.log 中看到以下错误,

[notice] 12451#0: signal 29 (SIGIO) received

我想知道程序在什么情况下会收到 SIGIO

最佳答案

对于异步信号代码应该执行这些步骤。

首先你应该让你的进程接收 SIGIO 然后 您的套接字或管道应置于异步模式。

在您的代码中搜索这些行

//allow the process to receive SIGIO
fcntl(fd, F_SETOWN, getpid());

//Make socket/pipe non-blocking
fcntl(fd, F_SETFL, FASYNC);

//Make socket/pipe non-blocking
fcntl(fd, F_SETFL, O_NONBLOCK);

要搜索的关键字是:F_SETOWNFASYNCO_NONBLOCK

关于linux - 程序接收信号SIGIO,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7414499/

相关文章:

c - C 中使用 SIGALRM 的定时器线程

bash 健壮性 : what is a correct and portable way to trap for the purpose of an "on exit" cleanup routine?

php - nginx/fastcgi 504 网关错误,增加 fastcgi_read_timeout 没有帮助

nginx - 如何编辑 nginx.conf 以增加上传文件大小

java - 显示 bash :/usr/lib/jvm/java-7-oracle=/usr/lib/jvm/java-8-oracle: No such file or directory in terminal

c - 6GB 大文件的 read() 在 x86_64 上失败

laravel - 在Docker之后运行的Nginx上的随机502/503错误(在ECS群集+ ALB上)

Python - 如何检测用户何时通过 "X"按钮关闭控制台应用程序

c - printf 调用的输出未显示在屏幕上

linux - 即使在 Tomcat 重启后 PermGen 问题仍然存在(Linux,Tomcat 6.0.35)