2018-10-31 03:06:57 +03:00
|
|
|
#pragma once
|
|
|
|
|
2018-10-31 04:09:11 +03:00
|
|
|
#include <sys/types.h>
|
2018-11-06 17:45:16 +03:00
|
|
|
#include <signal_numbers.h>
|
2018-10-31 03:06:57 +03:00
|
|
|
|
2018-10-31 04:09:11 +03:00
|
|
|
__BEGIN_DECLS
|
2018-10-31 03:06:57 +03:00
|
|
|
|
2018-11-05 18:40:48 +03:00
|
|
|
typedef void (*__sighandler_t)(int);
|
|
|
|
typedef __sighandler_t sighandler_t;
|
|
|
|
|
|
|
|
typedef uint32_t sigset_t;
|
|
|
|
typedef void siginfo_t;
|
2019-02-01 18:03:21 +03:00
|
|
|
typedef uint32_t sig_atomic_t;
|
2018-11-05 18:40:48 +03:00
|
|
|
|
|
|
|
struct sigaction {
|
2018-11-06 12:46:40 +03:00
|
|
|
union {
|
|
|
|
void (*sa_handler)(int);
|
|
|
|
void (*sa_sigaction)(int, siginfo_t*, void*);
|
|
|
|
};
|
2018-11-05 18:40:48 +03:00
|
|
|
sigset_t sa_mask;
|
|
|
|
int sa_flags;
|
|
|
|
void (*sa_restorer)(void);
|
|
|
|
};
|
|
|
|
|
2018-10-31 03:06:57 +03:00
|
|
|
int kill(pid_t, int sig);
|
2018-11-11 02:20:53 +03:00
|
|
|
int killpg(int pgrp, int sig);
|
2018-11-05 20:16:00 +03:00
|
|
|
sighandler_t signal(int sig, sighandler_t);
|
2018-11-06 14:02:58 +03:00
|
|
|
int sigaction(int sig, const struct sigaction* act, struct sigaction* old_act);
|
|
|
|
int sigemptyset(sigset_t*);
|
|
|
|
int sigfillset(sigset_t*);
|
|
|
|
int sigaddset(sigset_t*, int sig);
|
|
|
|
int sigdelset(sigset_t*, int sig);
|
|
|
|
int sigismember(const sigset_t*, int sig);
|
2018-11-11 01:29:07 +03:00
|
|
|
int sigprocmask(int how, const sigset_t* set, sigset_t* old_set);
|
|
|
|
int sigpending(sigset_t*);
|
2019-02-23 19:24:50 +03:00
|
|
|
int raise(int sig);
|
2018-10-31 03:06:57 +03:00
|
|
|
|
2018-11-06 17:45:16 +03:00
|
|
|
extern const char* sys_siglist[NSIG];
|
|
|
|
|
2018-11-05 18:40:48 +03:00
|
|
|
#define SIG_DFL ((__sighandler_t)0)
|
|
|
|
#define SIG_ERR ((__sighandler_t)-1)
|
|
|
|
#define SIG_IGN ((__sighandler_t)1)
|
|
|
|
|
2018-11-06 12:46:40 +03:00
|
|
|
#define SA_NOCLDSTOP 1
|
|
|
|
#define SA_NOCLDWAIT 2
|
|
|
|
#define SA_SIGINFO 4
|
|
|
|
|
2018-11-05 18:40:48 +03:00
|
|
|
#define SIG_BLOCK 0
|
|
|
|
#define SIG_UNBLOCK 1
|
|
|
|
#define SIG_SETMASK 2
|
|
|
|
|
2018-10-31 04:09:11 +03:00
|
|
|
__END_DECLS
|
2018-10-31 03:06:57 +03:00
|
|
|
|