xref: /haiku/headers/private/kernel/ksignal.h (revision a381c8a06378de22ff08adf4282b4e3f7e50d250)
1 /*
2  * Copyright 2003-2008, 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 #define SIGNAL_FLAG_DONT_RESTART_SYSCALL	(0x20000)
21 
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 extern bool handle_signals(struct thread *thread);
28 extern bool is_kill_signal_pending(void);
29 extern int has_signals_pending(void *_thread);
30 extern bool is_signal_blocked(int signal);
31 
32 extern void update_current_thread_signals_flag();
33 
34 extern int sigaction_etc(thread_id threadID, int signal,
35 	const struct sigaction *newAction, struct sigaction *oldAction);
36 
37 extern status_t _user_send_signal(pid_t tid, uint sig);
38 extern status_t _user_sigprocmask(int how, const sigset_t *set,
39 	sigset_t *oldSet);
40 extern status_t _user_sigaction(int sig, const struct sigaction *newAction,
41 	struct sigaction *oldAction);
42 extern bigtime_t _user_set_alarm(bigtime_t time, uint32 mode);
43 extern status_t _user_sigsuspend(const sigset_t *mask);
44 extern status_t _user_sigpending(sigset_t *set);
45 extern status_t _user_set_signal_stack(const stack_t *newUserStack,
46 	stack_t *oldUserStack);
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif	/* _KERNEL_SIGNAL_H */
53