Improve signal init and shutdown.
[paraslash.git] / signal.h
1 /*
2 * Copyright (C) 2007 Andre Noll <maan@tuebingen.mpg.de>
3 *
4 * Licensed under the GPL v2. For licencing details see COPYING.
5 */
6
7 /** \file signal.h exported symbols from signal.c */
8
9 /**
10 * Task for signal handling.
11 */
12 struct signal_task {
13 /** The signal pipe. */
14 int fd;
15 /** The associated task structure. */
16 struct task *task;
17 };
18
19 _static_inline_ void signal_pre_select(struct sched *s, void *context)
20 {
21 struct signal_task *st = context;
22 para_fd_set(st->fd, &s->rfds, &s->max_fileno);
23 }
24
25 struct signal_task *signal_init_or_die(void);
26 void para_sigaction(int sig, void (*handler)(int));
27 void para_install_sighandler(int);
28 int para_reap_child(pid_t *pid);
29 int para_next_signal(fd_set *rfds);
30 void signal_shutdown(struct signal_task *st);
31 void para_block_signal(int sig);
32 void para_unblock_signal(int sig);