1 /* Copyright (C) 2003-2022 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
36 if (pthread_sigmask (SIG_SETMASK
, NULL
, &ss2
) != 0)
38 puts ("child: sigmask failed");
43 for (i
= 1; i
< 32; ++i
)
44 if (sigismember (&ss
, i
) && ! sigismember (&ss2
, i
))
46 printf ("signal %d set in parent mask, but not in child\n", i
);
49 else if (! sigismember (&ss
, i
) && sigismember (&ss2
, i
))
51 printf ("signal %d set in child mask, but not in parent\n", i
);
63 sigaddset (&ss
, SIGUSR1
);
64 if (pthread_sigmask (SIG_SETMASK
, &ss
, NULL
) != 0)
66 puts ("1st sigmask failed");
71 if (pthread_create (&th
, NULL
, tf
, NULL
) != 0)
73 puts ("1st create failed");
78 if (pthread_join (th
, &r
) != 0)
80 puts ("1st join failed");
85 sigaddset (&ss
, SIGUSR2
);
86 sigaddset (&ss
, SIGFPE
);
87 if (pthread_sigmask (SIG_SETMASK
, &ss
, NULL
) != 0)
89 puts ("2nd sigmask failed");
93 if (pthread_create (&th
, NULL
, tf
, NULL
) != 0)
95 puts ("2nd create failed");
99 if (pthread_join (th
, &r
) != 0)
101 puts ("2nd join failed");
108 #define TEST_FUNCTION do_test ()
109 #include "../test-skeleton.c"