56 lines
1.4 KiB
C
56 lines
1.4 KiB
C
/* signal.h: Signal management. */
|
|
|
|
#ifndef _SIGNAL_H
|
|
#define _SIGNAL_H
|
|
|
|
#include <bits/signal.h>
|
|
#include <sys/types.h>
|
|
|
|
typedef int sig_atomic_t;
|
|
|
|
#define SIG_ERR (__simple_sighandler_t)(-3)
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
#pragma GCC push_options
|
|
#pragma GCC diagnostic ignored "-Wshadow"
|
|
/* Examine/change the current thread's signal disposition for a specific signal. */
|
|
int sigaction(int signo, const struct sigaction* act, struct sigaction* oldact);
|
|
#pragma GCC pop_options
|
|
|
|
/* Change the current thread's signal disposition for a specific signal. */
|
|
__simple_sighandler_t signal(int signo, __simple_sighandler_t handler);
|
|
|
|
/* Send a signal to a specific process. */
|
|
int kill(pid_t pid, int signo);
|
|
|
|
/* Send a signal to the current thread. */
|
|
int raise(int signo);
|
|
|
|
/* Modify the current thread's signal mask. */
|
|
int sigprocmask(int how, const sigset_t* set, sigset_t* oldset);
|
|
|
|
/* Clear all signals from set. */
|
|
int sigemptyset(sigset_t* set);
|
|
|
|
/* Add all signals to set. */
|
|
int sigfillset(sigset_t* set);
|
|
|
|
/* Add a specific signal to set. */
|
|
int sigaddset(sigset_t* set, int signo);
|
|
|
|
/* Remove a specific signal from set. */
|
|
int sigdelset(sigset_t* set, int signo);
|
|
|
|
/* Check if a signal is in set.*/
|
|
int sigismember(const sigset_t* set, int signo);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|