Hello everybody,took that as an occasion for contemplating about the whole Fselect() issue again.
With MiNT's new unlimited number of handles, wouldn't it only consequent to consider Fselect() in its current implementation broken by design?
I mean, with MiNT able to hold (approximately) 240 open handles (that's at least what my tests on Aranym showed) and Fselect() only able to listen on 26 of them, isn't that asking for trouble anyway?
I'd like to suggest to revert recent Fselect() changes (to avoid breaking "old" software) and introduce a new Fselect2() that better handles MiNT's new capabilities. This should at least allow to pass the (arbitrary) number of handles to listen on:
int Fselect2(int nfds, long *readfds, long *writefds, long *exceptfds, ?? *timeout);
Instead of passing long bitmaps by value, it would pass pointers to long arrays with nfds indicating the length of these. Whether timeout would be some kind of struct pointer or not is debatable (at least it would allow mintlib's select() implementation to become more UNIXish). A struct pointer would make the semantics of "wait forever" (pointer is NULL) and "immediately return" (values are 0) clear.
Fselect() would than work as before, Fselect2() could be used by (new) mintlib to better support select().
My own knowledge of MiNT internals are (embarassingly) minimal but I could at least offer to try and put a prototype implementation together if anybody is willing to help.
What do you think? Cheers, Markus Am 05.02.2015 um 11:28 schrieb Vincent Rivière:
On 05/02/2015 11:00, Pierre Ton-That wrote:Suggestion to myself: look into fselect() function, to see if something has changed in the CVS.Indeed, we changed Fselect() around 01/10/2014 to make the old MiNTLib select() more compatible (this fixes the slow keyboard in old vim binaries).Especially, the behaviour of the following has changed: Fselect(1,...) Previously, 1 meant very small timeout. Now it means: return immediately (no delay, never block) (while 0 still means infinite timeout) If you use Fselect(1,...), please use Fselect(2,...) instead. This fixed MyAES.