susetest:/tmp/audit-test-sle15-master/audit-test/utils/bin # make -o do_semop.c do_semop
cc -g -O2 -Wall -Werror -D_GNU_SOURCE -fno-strict-aliasing -DSUSE -DS390X -I../include do_semop.c -o do_semop
In file included from do_semop.c:18:0:
ipc_common.c: In function ‘do_semop’:
ipc_common.c:272:20: error: ‘NR_semop’ undeclared (first use in this function); did you mean ‘NR_shmdt’?
return syscall(__NR_semop, semid, &sops, 1);
~~~~~~~~~
__NR_shmdt
ipc_common.c:272:20: note: each undeclared identifier is reported only once for each function it appears in
ipc_common.c:274:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
cc1: all warnings being treated as errors
make: *** [: do_semop] Error 1
I did some investigation, and found that it might be a bug [may be by design on s390x, need confirm with developer later]
susetest:~ # cat /usr/include/asm/unistd_64.h |grep semop
susetest:~ # cat /usr/include/asm-generic/unistd.h|grep semop
#define NR_semop 193
__SYSCALL(NR_semop, sys_semop)
We can see that the syscall was not included in unistd_64.h file.
I did a minor fix on this c code:
susetest:/tmp/audit-test-sle15-master/audit-test/utils/bin # cat ipc_common.c |grep -A1 NR_semop, make can passed, but not sure if we can pass the tests
/* return syscall(__NR_semop, semid, &sops, 1); */
return semop(semid, &sops, 1);