diff options
Diffstat (limited to 'assert/assert.c')
| -rw-r--r-- | assert/assert.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/assert/assert.c b/assert/assert.c index db90b8d7ef..d21d76fa62 100644 --- a/assert/assert.c +++ b/assert/assert.c @@ -17,6 +17,7 @@ #include <intprops.h> #include <ldsodefs.h> +#include <libc-pointer-arith.h> #include <libintl.h> #include <libio/iolibio.h> #include <setvmaname.h> @@ -60,7 +61,8 @@ __assert_fail_base (const char *fmt, const char *assertion, const char *file, (void) __fxprintf (NULL, "%s", str); (void) fflush (stderr); - total = (total + 1 + GLRO(dl_pagesize) - 1) & ~(GLRO(dl_pagesize) - 1); + total = ALIGN_UP (total + sizeof (struct abort_msg_s) + 1, + GLRO(dl_pagesize)); struct abort_msg_s *buf = __mmap (NULL, total, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); if (__glibc_likely (buf != MAP_FAILED)) |
