Re: [PATCH] uapi: Make __{u,s}64 match {u,}int64_t in userspace

From
Arnd Bergmann <arnd@arndb.de>
Date
2021-11-22 20:49:08
Also in
linux-arch, lkml, ltp
Reply to
Cyril Hrubis, 2021-11-22
On Mon, Nov 22, 2021 at 5:43 PM Cyril Hrubis [off-list ref] wrote:
quoted hunk ↗ jump to hunk

+
+#include <asm/bitsperlong.h>
+
 /*
- * int-ll64 is used everywhere now.
+ * int-ll64 is used everywhere in kernel now.
  */
-#include <asm-generic/int-ll64.h>
+#if __BITS_PER_LONG == 64 && !defined(__KERNEL__)
+# include <asm-generic/int-l64.h>
+#else
+# include <asm-generic/int-ll64.h>
+#endif
I don't think this is correct on all 64-bit architectures, as far as I
remember the
definition can use either 'long' or 'long long' depending on the user space
toolchain.

Out of the ten supported 64-bit architectures, there are four that already
use asm-generic/int-l64.h conditionally, and six that don't, and I
think at least
some of those are intentional.

I think it would be safer to do this one architecture at a time to make
sure this doesn't regress on those that require the int-ll64.h version.

There should also be a check for __SANE_USERSPACE_TYPES__
to let userspace ask for the ll64 version everywhere.

          Arnd
Thread (23 messages) 23 messages, 9 authors, last reply 2022-06-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help