I've checked in a different fix for this to libc 2.1, that I think is correct and avoids some more busy-work. But I have not tested this code at all beyond compiling it, so please let me know how it is. I think the comments in the new code explain the rationale.