• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* Copyright (c) Jiri Palecek<jpalecek@web.de>, 2009 */
3 
4 #include "libsigwait.h"
5 
my_sigwait(const sigset_t * set,siginfo_t * info LTP_ATTRIBUTE_UNUSED,void * timeout LTP_ATTRIBUTE_UNUSED)6 static int my_sigwait(const sigset_t * set,
7 		      siginfo_t * info LTP_ATTRIBUTE_UNUSED,
8 		      void *timeout LTP_ATTRIBUTE_UNUSED)
9 {
10 	int ret;
11 	int err = sigwait(set, &ret);
12 
13 	if (err == 0)
14 		return ret;
15 	errno = err;
16 	return -1;
17 }
18 
19 struct sigwait_test_desc tests[] = {
20 	{ test_unmasked_matching_noinfo, SIGUSR1},
21 	{ test_masked_matching_noinfo, SIGUSR1},
22 };
23 
run(unsigned int i)24 static void run(unsigned int i)
25 {
26 	struct sigwait_test_desc *tc = &tests[i];
27 
28 	tc->tf(my_sigwait, tc->signo, TST_LIBC_TIMESPEC);
29 }
30 
31 static struct tst_test test = {
32 	.test= run,
33 	.tcnt = ARRAY_SIZE(tests),
34 	.setup = sigwait_setup,
35 	.forks_child = 1,
36 };
37