Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在 QNX 操作系统上用 C++ 编写一个 UDP 数据报接收器,我想执行非阻塞 recvfrom() 调用。
recvfrom() 上的QNX 手册页建议我可以使用 ioctl() 以某种方式将套接字置于非阻塞模式。不幸的是,ioctl() 的手册页并没有多大帮助。
谁能告诉我我必须传递给 ioctl() 以将套接字设置为非阻塞的参数吗?
QNX 6.4.0的ioctl文档有更多信息:
ioctl
飞安生物 设置或清除非阻塞 I/O
飞安生物
设置或清除非阻塞 I/O
ioctl调用应如下所示:
int on = 1; ioctl(fd, FIONBIO, &on);