Commit 5df2358f authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

zdtm/stopped: check more cases

Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent fa79ffd6
......@@ -123,6 +123,9 @@ TST_NOFILE = \
grow_map03 \
tun \
stopped \
stopped01 \
stopped02 \
stopped03 \
rtc \
clean_mntns \
mntns_rw_ro_rw \
......@@ -357,6 +360,9 @@ mlock_setuid: get_smaps_bits.o
inotify01: override CFLAGS += -DINOTIFY01
unlink_fstat01+: override CFLAGS += -DUNLINK_OVER
sk-freebind-false: override CFLAGS += -DZDTM_FREEBIND_FALSE
stopped01: override CFLAGS += -DZDTM_STOPPED_KILL
stopped02: override CFLAGS += -DZDTM_STOPPED_TKILL
stopped12: override CFLAGS += -DZDTM_STOPPED_KILL -DZDTM_STOPPED_TKILL
$(LIB): force
$(Q) $(MAKE) -C $(LIBDIR)
......
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <unistd.h>
#include <syscall.h>
#include <sys/wait.h>
#include "zdtmtst.h"
......@@ -38,6 +40,16 @@ int main(int argc, char **argv)
close(p[0]);
kill(pid, SIGSTOP);
if (waitid(P_PID, pid, NULL, WNOWAIT | WSTOPPED) < 0) {
pr_perror("waitid");
return 1;
}
#ifdef ZDTM_STOPPED_TKILL
syscall(__NR_tkill, pid, SIGSTOP);
#endif
#ifdef ZDTM_STOPPED_KILL
kill(pid, SIGSTOP);
#endif
write(p[1], "0", 1);
close(p[1]);
......
stopped.c
\ No newline at end of file
stopped.c
\ No newline at end of file
stopped.c
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment