Fix compiler issue with mmap_internal

Message ID 20211028212717.2311696-1-shorne@gmail.com
State Committed
Commit 6446c725d4df7d1a13fcf09be43975b263ad5b3d
Headers
Series Fix compiler issue with mmap_internal |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Stafford Horne Oct. 28, 2021, 9:27 p.m. UTC
  Compiling mmap_internal fails to compile when we use -1 for MMAP2_PAGE_UNIT
on 32 bit architectures.  The error is as follows:

    ../sysdeps/unix/sysv/linux/mmap_internal.h:30:8: error: unknown type
    name 'uint64_t'
    |
       30 | static uint64_t page_unit;
	  |
	  |        ^~~~~~~~

Fix by adding including stdint.h.
---
 sysdeps/unix/sysv/linux/mmap_internal.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Adhemerval Zanella Oct. 29, 2021, 12:14 p.m. UTC | #1
On 28/10/2021 18:27, Stafford Horne via Libc-alpha wrote:
> Compiling mmap_internal fails to compile when we use -1 for MMAP2_PAGE_UNIT
> on 32 bit architectures.  The error is as follows:
> 
>     ../sysdeps/unix/sysv/linux/mmap_internal.h:30:8: error: unknown type
>     name 'uint64_t'
>     |
>        30 | static uint64_t page_unit;
> 	  |
> 	  |        ^~~~~~~~
> 
> Fix by adding including stdint.h.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>


> ---
>  sysdeps/unix/sysv/linux/mmap_internal.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sysdeps/unix/sysv/linux/mmap_internal.h b/sysdeps/unix/sysv/linux/mmap_internal.h
> index 5ca6976191..35e112cc77 100644
> --- a/sysdeps/unix/sysv/linux/mmap_internal.h
> +++ b/sysdeps/unix/sysv/linux/mmap_internal.h
> @@ -19,6 +19,8 @@
>  #ifndef MMAP_INTERNAL_LINUX_H
>  #define MMAP_INTERNAL_LINUX_H 1
>  
> +#include <stdint.h>
> +
>  /* This is the minimum mmap2 unit size accept by the kernel.  An architecture
>     with multiple minimum page sizes (such as m68k) might define it as -1 and
>     thus it will queried at runtime.  */
>
  

Patch

diff --git a/sysdeps/unix/sysv/linux/mmap_internal.h b/sysdeps/unix/sysv/linux/mmap_internal.h
index 5ca6976191..35e112cc77 100644
--- a/sysdeps/unix/sysv/linux/mmap_internal.h
+++ b/sysdeps/unix/sysv/linux/mmap_internal.h
@@ -19,6 +19,8 @@ 
 #ifndef MMAP_INTERNAL_LINUX_H
 #define MMAP_INTERNAL_LINUX_H 1
 
+#include <stdint.h>
+
 /* This is the minimum mmap2 unit size accept by the kernel.  An architecture
    with multiple minimum page sizes (such as m68k) might define it as -1 and
    thus it will queried at runtime.  */