Switch to using poll(2) in place of select(2).
I've always thought poll was more hassle to set up, because if you want to reuse part of your pollfds list between calls then you have to index every fd by its position in the list as well as the fd number itself, which gives you twice as many indices to keep track of than if the fd is always its own key. But the problem is that select is fundamentally limited to the range of fds that can fit in an fd_set, which is not the range of fds that can _exist_, so I've had a change of heart and now have to go with poll. For the moment, I've surrounded it with a 'pollwrapper' structure that lets me treat it more or less like select, containing a tree234 that maps each fd to its location in the list, and also translating between the simple select r/w/x classification and the richer poll flags. That's let me do the migration with minimal disruption to the call sites. In future perhaps I can start using poll more directly, and/or using the richer flag system (though the latter might be fiddly because of sometimes being constrained to use the glib event loop). But this will do for now.
Showing
- Recipe 2 additions, 1 deletionRecipe
- cmdline.c 1 addition, 1 deletioncmdline.c
- configure.ac 1 addition, 1 deletionconfigure.ac
- putty.h 3 additions, 3 deletionsputty.h
- unix/unix.h 19 additions, 0 deletionsunix/unix.h
- unix/uxcons.c 8 additions, 10 deletionsunix/uxcons.c
- unix/uxnet.c 1 addition, 1 deletionunix/uxnet.c
- unix/uxpgnt.c 25 additions, 30 deletionsunix/uxpgnt.c
- unix/uxplink.c 30 additions, 39 deletionsunix/uxplink.c
- unix/uxpoll.c 136 additions, 0 deletionsunix/uxpoll.c
- unix/uxsel.c 2 additions, 2 deletionsunix/uxsel.c
- unix/uxserver.c 19 additions, 29 deletionsunix/uxserver.c
- unix/uxsftp.c 25 additions, 31 deletionsunix/uxsftp.c
Loading
Please register or sign in to comment