From f5e48e94a2f4d4bbd6e5628c7f2afafc6dbcc459 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 7 Mar 2024 17:28:52 -0500 Subject: build: Build mlibc + add distclean target Signed-off-by: Ian Moffett --- lib/mlibc/tests/posix/pthread_kill.c | 46 ------------------------------------ 1 file changed, 46 deletions(-) delete mode 100644 lib/mlibc/tests/posix/pthread_kill.c (limited to 'lib/mlibc/tests/posix/pthread_kill.c') diff --git a/lib/mlibc/tests/posix/pthread_kill.c b/lib/mlibc/tests/posix/pthread_kill.c deleted file mode 100644 index b740b70..0000000 --- a/lib/mlibc/tests/posix/pthread_kill.c +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include -#include - -_Atomic int handler_ready = 0; -_Atomic int thread_signal_ran = 0; - -static void sig_handler(int sig, siginfo_t *info, void *ctx) { - (void)sig; - (void)info; - (void)ctx; - - thread_signal_ran = 1; -} - -static void *worker(void *arg) { - (void)arg; - - struct sigaction sa; - sigemptyset(&sa.sa_mask); - sa.sa_sigaction = sig_handler; - sa.sa_flags = SA_SIGINFO; - assert(!sigaction(SIGUSR1, &sa, NULL)); - - handler_ready = 1; - - while (!thread_signal_ran) - ; - - return NULL; -} - -int main() { - pthread_t thread; - assert(!pthread_create(&thread, NULL, &worker, NULL)); - - while (!handler_ready) - ; - - assert(!pthread_kill(thread, SIGUSR1)); - assert(!pthread_join(thread, NULL)); - - assert(thread_signal_ran); - - return 0; -} -- cgit v1.2.3