This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Principles for syscall wrappers, again


On Tue, Jun 02, 2015 at 12:32:20AM +0200, Andreas Schwab wrote:
> Szabolcs Nagy <szabolcs.nagy@arm.com> writes:
> 
> > i assume providing the kernel futex api (as a variadic function)
> 
> Variadic functions are problematic.

I don't much like them either, but I also don't like casts to pass
val2 to FUTEX_*REQUEUE* and FUTEX_WAKE_OP. I also don't like that the
caller would have to unconditionally pass 6 arguments even for
commands (especially futex_wake) that only need 3 or 4. On lots of
targets 4 is the cutoff for arguments passed in registers, so always
passing 6 arguments will seriously pessimize code generation (stack
frame setup, register allocation, spillage, etc.) in the caller,
whereas futex is expected only to be called in an unlikely code path.

In any case this is a fairly minor issue and I don't want disagreement
over whether to make futex() variadic or not to derail it.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]