[RFC v6 08/23] RISC-V: Define __NR_* as __NR_*_time64/64 for 32-bit

Florian Weimer fweimer@redhat.com
Mon Jan 27 13:53:00 GMT 2020


* Arnd Bergmann:

> What is the problem with using a plain uintptr_t or struct timespec* and
> requiring callers to add a cast? Is this just a matter of ugly calling
> conventions, or are there cases where it causes bigger problems?

The problem with casts is that they make code compile which uses the
wrong timespec type.  Old 32-bit ports will have at least three of them,
and we should provide as much guidance as possible to programmers to get
this right.  If we require them to write casts, I don't think we can
achieve that.

> Would it help to have the libc futex wrapper take seven arguments with
> separate timeout and val2 arguments, and requiring at least one of them
> to be 0 or NULL? I think the only reason for the awkward interface in the
> kernel is that a syscall with seven arguments would require passing
> a structure on most architectures.

I hope that nowadays, we'd just add separate system calls instead of
multiplexers (even though futex_time64 doesn't give much hope).  Then
the different operations can use whatever argument types they need.

Thanks,
Florian



More information about the Libc-alpha mailing list