The epoll saga

I’ve been working on a java.nio.channels.Selector for GNU Classpath based on the epoll event notification mechanism, which is available on the 2.6 kernels. David was kind enough to point out that on 2.4 kernels with a newer libc, the sys/epoll.h header, as well as all the epoll functions, all exist, and all do nothing except return ENOSYS.

That’s a stellar failure mode there, guys. Thanks a pantload for that.

You quickly realize that this makes writing autoconf tests for epoll completely impossible: nothing you can test for will give you a real hint at whether or not the function is, in fact, supported. Oh sure, you could run a test program that tries to open an epoll file descriptor (eeech), but that won’t help out people who are cross-compiling, will it?

Oh, well, why not just add a configure switch that lets the user disable it by hand, you ask? Yeah, that’s a swell solution. Let’s introduce more configuration options for the poor user to guess the right values for.

Sub-rant ahoy!

What’s the deal with configure help output? The convention seems to be that you write:

  • –enable-FOO if FOO is not normally enabled,
  • –disable-FOO if FOO is normally enabled.

Of course, no-one follows this bogus convention anyway, and in the help output you’ll see a line saying “–enable-FOO … (default: yes)”. It’s even better when the help output is “–disable-FOO … (default: yes)”. Does the “yes” mean it’s disabled by default, or not?

Edit, FYI: this is not a debate, I think this behavior is completely stupid, and you have not convinced me otherwise.

Edit: toned down this post. I don’t mind being harsh, and it’s partly a joke, but I don’t want you to think I regard the glibc guys that lowly. I don’t, but they do say some goofy ass things sometimes.