fxlibc/include/signal.h

60 lines
1.2 KiB
C
Raw Normal View History

2021-05-09 23:00:11 +02:00
#ifndef __SIGNAL_H__
# define __SIGNAL_H__
2020-09-17 19:27:01 +02:00
2021-06-28 15:49:05 +02:00
#ifdef __cplusplus
extern "C" {
#endif
2020-09-17 19:27:01 +02:00
#include <stddef.h>
#include <stdint.h>
#include <stdatomic.h>
/* C99 API. */
typedef volatile atomic_int sig_atomic_t;
/* Type of a signal handler.*/
typedef void (*__sighandler_t)(int);
2021-05-09 16:35:40 +02:00
#include <bits/signum.h>
2020-09-17 19:27:01 +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
/* 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>
#include <sys/types.h>
2020-09-17 19:27:01 +02:00
/* Get and/or change the set of blocked signals. */
extern int sigprocmask (int __how, const sigset_t * __restrict__ __set,
sigset_t * __restrict__ __oldset);
2020-09-17 19:27:01 +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.
*/
extern int kill(pid_t __pid, int __sig);
#endif /*_POSIX_C_SOURCE*/
2020-09-17 19:27:01 +02:00
2021-06-28 15:49:05 +02:00
#ifdef __cplusplus
}
#endif
2021-05-09 23:00:11 +02:00
#endif /*__SIGNAL_H__*/