From 5ffc0c975693345ce0eb829b9faa3c50173730ed Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 27 Aug 2015 14:48:32 -0700 Subject: Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64. bionic is built without _FILE_OFFSET_BITS=64, so internally regoff_t was 32-bit on LP32, but code compiled with _FILE_OFFSET_BITS would expect rm_so and rm_eo in struct regmatch_t to be 64-bit, leading to confusion. Bug: http://b/23566443 Change-Id: Iae92fa545104068e4f64ce1977f5ec616859638c --- libc/include/regex.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libc') diff --git a/libc/include/regex.h b/libc/include/regex.h index aec38e334..b06a515b4 100644 --- a/libc/include/regex.h +++ b/libc/include/regex.h @@ -42,8 +42,9 @@ #include #include -/* types */ -typedef off_t regoff_t; +/* POSIX says regoff_t is at least as large as the larger of ptrdiff_t and + * ssize_t. BSD uses off_t, but that interacts badly with _FILE_OFFSET_BITS. */ +typedef ssize_t regoff_t; typedef struct { int re_magic; -- cgit v1.2.3