From 00fb5f97be5d6d8da10dbaf047004917b9f8c7e4 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 25 Jun 2014 12:09:11 -0700 Subject: [PATCH] Change the LP64 off_t/loff_t/off64_t definitions to reduce warnings. Code written for glibc can be sloppy about these types on LP64 and get away with it. It's probably better for our users if these types are identical rather than just being the same size. Change-Id: I3dd116d80569d2d101342a552c55f4a18884025b --- libc/include/sys/types.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libc/include/sys/types.h b/libc/include/sys/types.h index 9a76ad260..a5fa69290 100644 --- a/libc/include/sys/types.h +++ b/libc/include/sys/types.h @@ -91,12 +91,17 @@ typedef __kernel_time_t __time_t; typedef __time_t time_t; /* This historical accident means that we had a 32-bit off_t on 32-bit architectures. */ -#ifndef _OFF_T_DEFINED_ -#define _OFF_T_DEFINED_ +#if !defined(__LP64__) typedef __kernel_off_t off_t; -#endif typedef __kernel_loff_t loff_t; typedef loff_t off64_t; +#else +/* We could re-use the LP32 definitions, but that would mean that although off_t and loff_t/off64_t + * would be the same size, they wouldn't actually be the same type, which can lead to warnings. */ +typedef __kernel_off_t off_t; +typedef off_t loff_t; +typedef loff_t off64_t; +#endif /* while POSIX wants these in , we * declare then in instead */