Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

The libcurl multi documentation states:

The older API to accomplish the same thing is curl_multi_fdset that extracts fd_sets from libcurl to use in select() or poll() calls in order to get to know when the transfers in the multi stack might need attention.

curl_multi_fdset() returns three struct fd_set to be used with select() ( code example from documentation ).

But how can I use these fd_set with poll()?

EDIT : The bigger picture: I want to integrate libcurl into my application, which itself provides an event loop, that is completely based on polling file descriptors. So my ultimate goal is to export the libcurl file descriptors and import these into my event handler.

You use either of the three: curl_multi_poll , select , or poll – they let you achieve the same goal. For poll example, look up poll manual. paiv Jun 17, 2021 at 17:49 @paiv thanks for your answer! However, I am still struggling to use the struct fd_set with the poll() function as described in the manual. Any thoughts on that? linux.die.net/man/3/poll Martin H. Jun 21, 2021 at 6:37 i think that most often it doesn't really matter, you can use curl_multi_wait() instead of poll(), curl_multi_wait() even support polling with arbitrary stuff through the optional struct curl_waitfd extra_fds[] argument.. but i'd still like to see the answer to this one hanshenrik Jun 23, 2021 at 19:11

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .