2 * Check fault injection along with signal injection.
4 * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@altlinux.org>
5 * Copyright (c) 2017-2019 The strace developers.
8 * SPDX-License-Identifier: GPL-2.0-or-later
17 static struct stat before, after;
22 if (stat(".", &after))
23 syscall(__NR_exit_group, 2);
25 if (before.st_dev != after.st_dev || before.st_ino != after.st_ino)
26 syscall(__NR_exit_group, 3);
28 syscall(__NR_exit_group, 0);
34 const struct sigaction act = { .sa_handler = handler };
35 if (sigaction(SIGUSR1, &act, NULL))
36 perror_msg_and_fail("sigaction");
40 sigaddset(&mask, SIGUSR1);
41 if (sigprocmask(SIG_UNBLOCK, &mask, NULL))
42 perror_msg_and_fail("sigprocmask");
44 if (stat(".", &before))
45 perror_msg_and_fail("stat");
47 syscall(__NR_chdir, ".");
48 syscall(__NR_exit_group, 1);