This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: epoll_pwait broken?
Lots of kernel/userspace interfaces look different, especially the ones which take a signal mask as a parameter. Most of the kernel syscalls require the size of the signal mask to be provided, but must of the library level calls do not. They always pass _NSIG / 8.
It would be inconsistent not to do the same thing for epoll_pwait.
Yes, there's more code in glibc, but it's not such a huge deal. In terms of the binary, it comes out as a single extra "load constant" instruction.
And believe me, at least for x86, the compiler isn't going to be able to optimize the constant load. The reason is that the %ebp register is required for that final parameter.
Davin
On Tue, 23 Jan 2007 15:52:17 -0500
"Carlos O'Donell" <carlos@systemhalted.org> wrote:
>
> Why not export the kernel interface as is, and avoid adding a wrapper?
> Why does glibc need to take care of this?
>
> Pros:
> - User doesn't have to type "sizeof (sigset_t)"
>
> Cons:
> - More code in glibc.
> - Compiler can't optimize constant load for multiple epoll_pwait calls.
> - Kernel and userspace interfaces look different in the documentation.
>
> Cheers,
> Carlos.