2 * Check fault injection along with signal injection.
4 * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@altlinux.org>
7 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include <asm/unistd.h>
16 static struct stat before, after;
21 if (stat(".", &after))
22 syscall(__NR_exit_group, 2);
24 if (before.st_dev != after.st_dev || before.st_ino != after.st_ino)
25 syscall(__NR_exit_group, 3);
27 syscall(__NR_exit_group, 0);
33 const struct sigaction act = { .sa_handler = handler };
34 if (sigaction(SIGUSR1, &act, NULL))
35 perror_msg_and_fail("sigaction");
39 sigaddset(&mask, SIGUSR1);
40 if (sigprocmask(SIG_UNBLOCK, &mask, NULL))
41 perror_msg_and_fail("sigprocmask");
43 if (stat(".", &before))
44 perror_msg_and_fail("stat");
46 syscall(__NR_chdir, ".");
47 syscall(__NR_exit_group, 1);