xref: /haiku/headers/private/kernel/ksignal.h (revision d9cebac2b77547b7064f22497514eecd2d047160)
1 /*
2  * Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _KERNEL_SIGNAL_H
6 #define _KERNEL_SIGNAL_H
7 
8 
9 #include <KernelExport.h>
10 #include <signal.h>
11 
12 
13 #define KILL_SIGNALS	((1L << (SIGKILL - 1)) | (1L << (SIGKILLTHR - 1)))
14 
15 #define SIGNAL_TO_MASK(signal)	(1LL << (signal - 1))
16 
17 // additional send_signal_etc() flag
18 #define SIGNAL_FLAG_TEAMS_LOCKED	(0x10000)
19 	// interrupts are disabled and team lock is held
20 
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 extern bool handle_signals(struct thread *thread);
27 extern bool is_kill_signal_pending(void);
28 extern int has_signals_pending(void *_thread);
29 extern bool is_signal_blocked(int signal);
30 
31 extern int sigaction_etc(thread_id threadID, int signal,
32 	const struct sigaction *newAction, struct sigaction *oldAction);
33 
34 extern status_t _user_send_signal(pid_t tid, uint sig);
35 extern status_t _user_sigprocmask(int how, const sigset_t *set,
36 	sigset_t *oldSet);
37 extern status_t _user_sigaction(int sig, const struct sigaction *newAction,
38 	struct sigaction *oldAction);
39 extern bigtime_t _user_set_alarm(bigtime_t time, uint32 mode);
40 extern status_t _user_sigsuspend(const sigset_t *mask);
41 extern status_t _user_sigpending(sigset_t *set);
42 extern status_t _user_set_signal_stack(const stack_t *newUserStack,
43 	stack_t *oldUserStack);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif	/* _KERNEL_SIGNAL_H */
50