From 650ef3853994b49182d0ee64b445ef7866fabe86 Mon Sep 17 00:00:00 2001 From: Alexander Aring Date: Tue, 11 Sep 2012 07:30:44 +0200 Subject: sandbox: fix posix_types Fix setting of size_t ssize_t and ptrdiff_t for 32 bit and 64 bit systems. Signed-off-by: Alexander Aring Signed-off-by: Sascha Hauer --- arch/sandbox/include/asm/posix_types.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/sandbox/include/asm/posix_types.h b/arch/sandbox/include/asm/posix_types.h index 4345141d29..6985b8eb4a 100644 --- a/arch/sandbox/include/asm/posix_types.h +++ b/arch/sandbox/include/asm/posix_types.h @@ -15,9 +15,23 @@ typedef int __kernel_pid_t; typedef unsigned short __kernel_ipc_pid_t; typedef unsigned short __kernel_uid_t; typedef unsigned short __kernel_gid_t; +/* + * Most 32 bit architectures use "unsigned int" size_t, + * and all 64 bit architectures use "unsigned long" size_t. + * + * TODO: It's not clean to use __x86_64__ here. It's better + * to check on __BITS_PER_LONG here. But this is wrong set in + * arch/sandbox/include/asm/types.h. + */ +#ifdef __x86_64__ typedef unsigned long __kernel_size_t; typedef long __kernel_ssize_t; +typedef long __kernel_ptrdiff_t; +#else +typedef unsigned int __kernel_size_t; +typedef int __kernel_ssize_t; typedef int __kernel_ptrdiff_t; +#endif typedef long __kernel_time_t; typedef long __kernel_suseconds_t; typedef long __kernel_clock_t; -- cgit v1.2.3