Lines Matching +full:signal +full:- +full:id
1 // SPDX-License-Identifier: GPL-2.0-only
13 #include <signal.h>
87 diff = end.tv_usec - start.tv_usec; in check_diff()
88 diff += (end.tv_sec - start.tv_sec) * USEC_PER_SEC; in check_diff()
90 if (llabs(diff - DELAY * USEC_PER_SEC) > USEC_PER_SEC / 2) { in check_diff()
92 return -1; in check_diff()
108 signal(SIGVTALRM, sig_handler); in check_itimer()
110 signal(SIGPROF, sig_handler); in check_itimer()
112 signal(SIGALRM, sig_handler); in check_itimer()
139 timer_t id; in check_timer_create() local
143 if (timer_create(which, NULL, &id) < 0) in check_timer_create()
146 if (signal(SIGALRM, sig_handler) == SIG_ERR) in check_timer_create()
147 fatal_error(name, "signal()"); in check_timer_create()
152 if (timer_settime(id, 0, &val, NULL) < 0) in check_timer_create()
171 ctd_count--; in ctd_sighandler()
182 timer_t id; in ctd_thread_func() local
188 if (timer_create(CLOCK_PROCESS_CPUTIME_ID, NULL, &id)) in ctd_thread_func()
190 if (timer_settime(id, 0, &val, NULL)) in ctd_thread_func()
195 if (timer_delete(id)) in ctd_thread_func()
202 * Test that only the running thread receives the timer signal.
206 if (signal(SIGALRM, ctd_sighandler) == SIG_ERR) in check_timer_distribution()
207 fatal_error(NULL, "signal()"); in check_timer_distribution()
216 ksft_test_result_pass("check signal distribution\n"); in check_timer_distribution()
218 ksft_test_result_fail("check signal distribution\n"); in check_timer_distribution()
220 ksft_test_result_skip("check signal distribution (old kernel)\n"); in check_timer_distribution()
230 struct tmrsig *tsig = si ? si->si_ptr : NULL; in siginfo_handler()
233 tsig->signals++; in siginfo_handler()
234 tsig->overruns += si->si_overrun; in siginfo_handler()
279 /* Block the signal */ in check_sig_ign()
306 /* Set the signal to be ignored */ in check_sig_ign()
307 if (signal(SIGUSR1, SIG_IGN) == SIG_ERR) in check_sig_ign()
308 fatal_error(NULL, "signal(SIG_IGN)"); in check_sig_ign()
313 /* Stop the thread first. No signal should be delivered to it */ in check_sig_ign()
326 /* Unblock it, which should deliver the signal in the !thread case*/ in check_sig_ign()
357 /* Block the signal */ in check_rearm()
388 /* Unblock it, which should not deliver a signal */ in check_rearm()
413 /* Block the signal */ in check_delete()
439 /* Unblock it, which should not deliver a signal */ in check_delete()
450 diff = NSEC_PER_SEC * (int64_t)((int) t1.tv_sec - (int) t2.tv_sec); in calcdiff_ns()
451 diff += ((int) t1.tv_nsec - (int) t2.tv_nsec); in calcdiff_ns()
502 /* Block the signal */ in check_gettime()
562 /* Block the signal */ in check_overrun()
591 /* Unblock it, which should deliver a signal */ in check_overrun()