Re: [msysGit] Re: [PATCH] compat: Add another rudimentary poll() emulation
- From
- Albert Dvornik <dvornik+git@gmail.com>
- Date
- May 27, 2010, 13:43 UTC
- Message-ID
- <AANLkTikU4ZzX4yYVSCOuLxjp56cmmolHk1u0U-fhfTtN@mail.gmail.com>
- In-Reply-To
- <AANLkTiliJFXWKXnksQryvAivadrkTUeZ1Wu7FkUGm2YZ@mail.gmail.com>
On Thu, May 27, 2010 at 8:57 AM, Erik Faye-Lund <kusmabite@googlemail.com> wrote:
> On Thu, May 27, 2010 at 2:36 PM, Marko Kreen <markokr@gmail.com> wrote:
[...]
Show 11 quoted lines
>> Hm, good catch. Seems such compat poll() cannot be done without >> OS-specific hacks. >> > > Perhaps getrlimit() could overridden to return FD_SETSIZE for both the > soft and hard limit when asking about RLIMIT_NOFILE? In such cases, > anyone who passes nfds above FD_SETSIZE hasn't consulted > RLIMIT_NOFILE, and should be outside the standard. But your point > might have been about a limitless poll()-implementation, like the code > you linked tried to achieve. In that context, no. I doubt it's > possible to do in a robust fashion.
This is getting far off-topic, but I do think it's possible to do in a robust fashion if you are willing to sacrifice some performance [i.e. we should not consider this for Git =) ], by creating multiple fd_set structures and only shoving up to FD_SETSIZE descriptors into each. Cycling between the structures would cause some extra latency and a LOT more code complexity, but it should work.
--bert