[CRIU] [PATCH] test/zdtm: fix compilation of maps02.c
Nicolas Dichtel
nicolas.dichtel at 6wind.com
Fri Oct 3 06:20:54 PDT 2014
Le 03/10/2014 12:03, Andrey Vagin a écrit :
> On Fri, Oct 03, 2014 at 12:49:02PM +0400, Pavel Emelyanov wrote:
>> On 10/02/2014 05:12 PM, Nicolas Dichtel wrote:
>>> Error was:
>>> maps02.c: In function ‘main’:
>>> maps02.c:57:74: error: ‘MADV_DONTDUMP’ undeclared (first use in this function)
>>> maps02.c:57:74: note: each undeclared identifier is reported only once for each function it appears in
>>> make: *** [maps02] Error 1
>>> ERROR: fail to start /home/root/criu/test/zdtm/live/static/maps02
>>>
>>> Signed-off-by: Nicolas Dichtel <nicolas.dichtel at 6wind.com>
>>
>> Andrey, please, review the patch.
>>
>>> ---
>>> test/zdtm/live/static/maps02.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/test/zdtm/live/static/maps02.c b/test/zdtm/live/static/maps02.c
>>> index 336044fea672..b9fb27bb4c45 100644
>>> --- a/test/zdtm/live/static/maps02.c
>>> +++ b/test/zdtm/live/static/maps02.c
>>> @@ -1,5 +1,6 @@
>>> #include <sys/mman.h>
>>> #include "zdtmtst.h"
>>> +#include <asm-generic/mman-common.h>
>
> asm-generic/mman-common.h can't be used directly.
>
> Looks like you use old headers. MADV_DONTDUMP was added recently.
Right old headers with a custom kernel (vanilla 3.17-rc7).
> commit accb61fe7bb0f5c2a4102239e4981650f9048519
> Author: Jason Baron <jbaron at redhat.com>
> Date: Fri Mar 23 15:02:51 2012 -0700
>
> coredump: add VM_NODUMP, MADV_NODUMP, MADV_CLEAR_NODUMP
>
> Look at my headers:
>
> [root at avagin-fc19-cr include]# grep -r "define MADV_DONTDUMP" .
> ./bits/mman-linux.h:# define MADV_DONTDUMP 16
> ./asm-generic/mman-common.h:#define MADV_DONTDUMP 16
>
> ./bits/mman.h:#include <bits/mman-linux.h>
> ./sys/mman.h:#include <bits/mman.h>
>
>
> ./asm-generic/mman.h:#include <asm-generic/mman-common.h>
> ./asm/mman.h:#include <asm-generic/mman.h>
> ./linux/mman.h:#include <asm/mman.h>
>
>
> You can try to include ./linux/mman.h or use smth like this:
>
> #ifndef MADV_DONTDUMP
> #define MADV_DONTDUMP 16
> #endif
Ok.
More information about the CRIU
mailing list