2021-05-09 23:00:11 +02:00
|
|
|
#ifndef __SIGNAL_H__
|
|
|
|
# define __SIGNAL_H__
|
2020-09-17 19:27:01 +02:00
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
2021-05-29 18:26:33 +02:00
|
|
|
#include <stdatomic.h>
|
|
|
|
|
|
|
|
/* C99 API. */
|
|
|
|
|
|
|
|
typedef volatile atomic_int sig_atomic_t;
|
|
|
|
|
|
|
|
/* Type of a signal handler.*/
|
|
|
|
typedef void (*__sighandler_t)(int);
|
2020-11-03 15:15:01 +01:00
|
|
|
|
2021-05-09 16:35:40 +02:00
|
|
|
#include <bits/signum.h>
|
2020-09-17 19:27:01 +02:00
|
|
|
|
2021-05-29 18:26:33 +02:00
|
|
|
/* Set the handler for __signum. */
|
|
|
|
extern __sighandler_t signal(int __signum, __sighandler_t __handler);
|
|
|
|
|
|
|
|
/* Raise signal __signum. */
|
|
|
|
extern int raise(int __signum);
|
|
|
|
|
|
|
|
/* POSIX API (Vhex only). */
|
|
|
|
|
|
|
|
#ifdef _POSIX_C_SOURCE
|
|
|
|
|
2020-10-14 11:45:08 +02:00
|
|
|
/* Type of signal set */
|
|
|
|
typedef uint32_t sigset_t;
|
|
|
|
typedef uint32_t kernel_sigset_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Get the system-specific definitions of `struct sigaction' and the `SA_*'
|
|
|
|
** and `SIG_*'. constants.
|
|
|
|
*/
|
|
|
|
#include <bits/sigaction.h>
|
2021-05-29 18:26:33 +02:00
|
|
|
#include <sys/types.h>
|
2020-09-17 19:27:01 +02:00
|
|
|
|
2020-10-14 11:45:08 +02:00
|
|
|
/* Get and/or change the set of blocked signals. */
|
2021-05-29 18:26:33 +02:00
|
|
|
extern int sigprocmask (int __how, const sigset_t *restrict __set,
|
|
|
|
sigset_t *restrict __oldset);
|
2020-09-17 19:27:01 +02:00
|
|
|
|
2020-10-14 11:45:08 +02:00
|
|
|
/*
|
|
|
|
** Send signal SIG to process number PID. If PID is zero, send SIG to all
|
|
|
|
** processes in the current process's process group. If PID is < -1, send SIG to
|
|
|
|
** all processes in process group - PID.
|
|
|
|
*/
|
2021-05-29 18:26:33 +02:00
|
|
|
extern int kill(pid_t __pid, int __sig);
|
2020-10-14 11:45:08 +02:00
|
|
|
|
2021-05-29 18:26:33 +02:00
|
|
|
#endif /*_POSIX_C_SOURCE*/
|
2020-09-17 19:27:01 +02:00
|
|
|
|
2021-05-09 23:00:11 +02:00
|
|
|
#endif /*__SIGNAL_H__*/
|