[LTP] [PATCH v1] Move semaphore/ tests to semop/

Petr Vorel pvorel@suse.cz
Thu Jan 19 19:00:27 CET 2023


Hi Wei,

> There is no point in having two different directories with semop()
> testcaes so it would make sense to move these two tests into the
> syscalls/ipc/semop/ directory as semop04 and semop05.
> So we move ipc/semaphore/ tests to syscalls/ipc/semop/.
> Also update runtest files accordingly.

testcases/kernel/ipc/semaphore/Makefile
links with libpthread.so.0:
LDLIBS			+= -lpthread

Although it looks like only sem02.c uses pthread functions.
https://man7.org/linux/man-pages/man7/pthreads.7.html

testcases/kernel/syscalls/ipc/semop/Makefile
links with ltp library libltpnewipc.a:
LTPLDLIBS  = -lltpnewipc
which uses /proc/sysvipc/
https://man7.org/linux/man-pages/man7/sysvipc.7.html

I'm not sure if it's good idea to mix both
@Cyril any input?

> +++ b/testcases/kernel/syscalls/ipc/semop/Makefile
> @@ -8,5 +8,6 @@ LTPLIBS = ltpnewipc
>  include $(top_srcdir)/include/mk/testcases.mk

>  LTPLDLIBS  = -lltpnewipc
> +LDLIBS    += -lpthread

If it's ok to merge them into single directory, it'd be better to specify
used libraries for files which need them. e.g.:

semop01: LTPLDLIBS  = -lltpnewipc
semop02: LTPLDLIBS  = -lltpnewipc
semop03: LTPLDLIBS  = -lltpnewipc
semop05: LDLIBS    += -lpthread

Kind regards,
Petr


More information about the ltp mailing list