[1/1] libapi: Add missing linux/types.h header to get the __u64 type on io.h

Message ID ZWjDPL+IzPPsuC3X@kernel.org
State New
Headers
Series [1/1] libapi: Add missing linux/types.h header to get the __u64 type on io.h |

Commit Message

Arnaldo Carvalho de Melo Nov. 30, 2023, 5:15 p.m. UTC
  There are functions using __u64, so we need to have the linux/types.h
header otherwise we'll break when its not included before api/io.h.

Fixes: e95770af4c4a280f ("tools api: Add a lightweight buffered reading api")
Cc: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/api/io.h | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Ian Rogers Nov. 30, 2023, 5:57 p.m. UTC | #1
On Thu, Nov 30, 2023 at 9:15 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> There are functions using __u64, so we need to have the linux/types.h
> header otherwise we'll break when its not included before api/io.h.
>
> Fixes: e95770af4c4a280f ("tools api: Add a lightweight buffered reading api")
> Cc: Ian Rogers <irogers@google.com>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Link: https://lore.kernel.org/lkml/
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/lib/api/io.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/lib/api/io.h b/tools/lib/api/io.h
> index a77b74c5fb655a8c..2a7fe9758813172d 100644
> --- a/tools/lib/api/io.h
> +++ b/tools/lib/api/io.h
> @@ -12,6 +12,7 @@
>  #include <stdlib.h>
>  #include <string.h>
>  #include <unistd.h>
> +#include <linux/types.h>
>
>  struct io {
>         /* File descriptor being read/ */
> --
> 2.41.0
>
  

Patch

diff --git a/tools/lib/api/io.h b/tools/lib/api/io.h
index a77b74c5fb655a8c..2a7fe9758813172d 100644
--- a/tools/lib/api/io.h
+++ b/tools/lib/api/io.h
@@ -12,6 +12,7 @@ 
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <linux/types.h>
 
 struct io {
 	/* File descriptor being read/ */