[LTP] [PATCH 2/8] lapi: Add a configure check and fallback for setns

Cyril Hrubis chrubis@suse.cz
Mon Mar 9 11:34:00 CET 2020


Hi!
> There is an error for old glibc on centos 06:
> 
> https://api.travis-ci.org/v3/job/659994070/log.txt
> 
> In file included from /usr/src/ltp/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c:21:
> 
> /usr/src/ltp/include/lapi/setns.h: In function 'setns':
> 
> /usr/src/ltp/include/lapi/setns.h:16: error: implicit declaration of function 'syscall'

Hmm, I guess that we can include unistd.h in the lapi/syscalls.h so that
the syscall() function has a prototype.

> /usr/src/ltp/include/lapi/setns.h:16: error: implicit declaration of function 'tst_brk'
> 
> /usr/src/ltp/include/lapi/setns.h:16: error: 'TCONF' undeclared (first use in this function)
> 
> /usr/src/ltp/include/lapi/setns.h:16: error: (Each undeclared identifier is reported only once
> 
> /usr/src/ltp/include/lapi/setns.h:16: error: for each function it appears in.)
> 
> In file included from /usr/src/ltp/include/tst_test.h:14,
> 
>                  from /usr/src/ltp/include/tst_safe_clocks.h:13,
> 
>                  from /usr/src/ltp/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c:22:

Okay, I guess that both errors could be fixed by moving the lapi/setns.h
include after the tst_test.h in the test, because tst_test.h both
includes unistd.h as well as defines the tst_brk() and TCONF.

Thanks for spotting this.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list