test: static,aio01 -- Predefine SIGNAL_H

Submitted by Radostin Stoyanov on June 15, 2018, 5:44 a.m.

Details

Message ID 20180615054404.31414-1-rstoyanov1@gmail.com
State New
Series "test: static,aio01 -- Predefine SIGNAL_H"
Headers show

Commit Message

Radostin Stoyanov June 15, 2018, 5:44 a.m.
After commit the commit below, <linux/signal.h> is included
in <linux/aio_abi.h>

https://github.com/torvalds/linux/commit/7a074e96

This causes compilation the following errors:

In file included from /usr/include/linux/signal.h:5,
                 from /usr/include/linux/aio_abi.h:32,
                 from aio01.c:1:
/usr/include/asm/signal.h:127:2: error: unknown type name ‘size_t’
  size_t ss_size;
  ^~~~~~
In file included from aio01.c:1:
/usr/include/linux/aio_abi.h:112:2: error: unknown type name ‘size_t’
  size_t  sigsetsize;
  ^~~~~~
In file included from /usr/include/sys/select.h:33,
                 from /usr/include/sys/types.h:196,
                 from aio01.c:3:
/usr/include/bits/types/sigset_t.h:7:20: error: conflicting types for ‘sigset_t’
 typedef __sigset_t sigset_t;
                    ^~~~~~~~
In file included from /usr/include/linux/signal.h:5,
                 from /usr/include/linux/aio_abi.h:32,
                 from aio01.c:1:
/usr/include/asm/signal.h:16:23: note: previous declaration of ‘sigset_t’ was here
 typedef unsigned long sigset_t;
                       ^~~~~~~~

As a workaround, we can predefine SIGNAL_H to ignore this include.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
---
 test/zdtm/static/aio01.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/aio01.c b/test/zdtm/static/aio01.c
index f84fd359..1a9aff88 100644
--- a/test/zdtm/static/aio01.c
+++ b/test/zdtm/static/aio01.c
@@ -1,3 +1,4 @@ 
+#define _ASM_X86_SIGNAL_H
 #include <linux/aio_abi.h>
 #include <sys/syscall.h>
 #include <sys/types.h>

Comments

Andrey Vagin June 15, 2018, 7:10 a.m.
On Fri, Jun 15, 2018 at 06:44:04AM +0100, Radostin Stoyanov wrote:
> After commit the commit below, <linux/signal.h> is included
> in <linux/aio_abi.h>
> 
> https://github.com/torvalds/linux/commit/7a074e96
> 
> This causes compilation the following errors:
> 
> In file included from /usr/include/linux/signal.h:5,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from aio01.c:1:
> /usr/include/asm/signal.h:127:2: error: unknown type name ‘size_t’
>   size_t ss_size;
>   ^~~~~~
> In file included from aio01.c:1:
> /usr/include/linux/aio_abi.h:112:2: error: unknown type name ‘size_t’
>   size_t  sigsetsize;
>   ^~~~~~
> In file included from /usr/include/sys/select.h:33,
>                  from /usr/include/sys/types.h:196,
>                  from aio01.c:3:
> /usr/include/bits/types/sigset_t.h:7:20: error: conflicting types for ‘sigset_t’
>  typedef __sigset_t sigset_t;
>                     ^~~~~~~~
> In file included from /usr/include/linux/signal.h:5,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from aio01.c:1:
> /usr/include/asm/signal.h:16:23: note: previous declaration of ‘sigset_t’ was here
>  typedef unsigned long sigset_t;
>                        ^~~~~~~~
> 
> As a workaround, we can predefine SIGNAL_H to ignore this include.
> 
> Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
> ---
>  test/zdtm/static/aio01.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/test/zdtm/static/aio01.c b/test/zdtm/static/aio01.c
> index f84fd359..1a9aff88 100644
> --- a/test/zdtm/static/aio01.c
> +++ b/test/zdtm/static/aio01.c
> @@ -1,3 +1,4 @@
> +#define _ASM_X86_SIGNAL_H

What is about other arch-s? We run our tests on arm32, s390, ppc64le,
aarch64.

>  #include <linux/aio_abi.h>
>  #include <sys/syscall.h>
>  #include <sys/types.h>
> -- 
> 2.17.1
> 
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu