gpt4 book ai didi

c - poll 和 epoll 事件标志兼容吗?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:15:37 28 4
gpt4 key购买 nike

我正在尝试让 libusb 与 epoll 而不是 poll 一起工作,因为我已经在需要可扩展性且只会运行的应用程序中使用 epoll在 Linux 上。我想知道用于轮询的 libusb_get_pollfds 返回的 events 标志是否与 epoll 兼容。

例如,POLLIN 标志是否可以在 epoll 中注册并实现与 EPOLLIN 标志相同的行为,或者我是否需要将这些事件标志映射到它们对应的 epoll 版本?

最佳答案

Can the POLLIN flag, for example, be registered with epoll and achieve the same behavior as the EPOLLIN flag, or do I need to map these event flags to their corresponding epoll version?

answer正在讲述。摘录:

The most glaring problem with epoll documentation is its failure to state in "bold caps" that epoll events, are, in fact, fully identical to poll (2) events.

关于c - poll 和 epoll 事件标志兼容吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30685515/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com