2022-03-25 14:11:44 +00:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_CALLS_SIGNALS_INTERNAL_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_CALLS_SIGNALS_INTERNAL_H_
|
|
|
|
#include "libc/calls/struct/sigset.h"
|
2022-04-12 12:20:17 +00:00
|
|
|
#include "libc/calls/ucontext.h"
|
2022-03-25 14:11:44 +00:00
|
|
|
|
|
|
|
#define __SIG_QUEUE_LENGTH 8
|
|
|
|
#define __SIG_POLLING_INTERVAL_MS 50
|
2022-04-12 12:20:17 +00:00
|
|
|
#define __SIG_LOGGING_INTERVAL_MS 1700
|
2022-03-25 14:11:44 +00:00
|
|
|
|
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
2022-04-12 15:05:22 +00:00
|
|
|
struct Signal {
|
|
|
|
struct Signal *next;
|
|
|
|
bool used;
|
|
|
|
int sig;
|
|
|
|
int si_code;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Signals {
|
|
|
|
sigset_t mask;
|
|
|
|
struct Signal *queue;
|
|
|
|
struct Signal mem[__SIG_QUEUE_LENGTH];
|
|
|
|
};
|
|
|
|
|
2022-04-24 16:59:22 +00:00
|
|
|
extern long __sig_count;
|
2022-06-11 08:59:26 +00:00
|
|
|
extern struct Signals __sig;
|
2022-04-12 15:05:22 +00:00
|
|
|
|
2022-03-25 14:11:44 +00:00
|
|
|
bool __sig_check(bool) hidden;
|
2022-04-12 12:20:17 +00:00
|
|
|
bool __sig_handle(bool, int, int, ucontext_t *) hidden;
|
2022-03-25 14:11:44 +00:00
|
|
|
int __sig_add(int, int) hidden;
|
2022-04-12 12:20:17 +00:00
|
|
|
int __sig_mask(int, const sigset_t *, sigset_t *) hidden;
|
|
|
|
int __sig_raise(int, int) hidden;
|
2022-09-05 16:17:56 +00:00
|
|
|
void __sig_check_ignore(const int, const unsigned) hidden;
|
2022-09-07 12:38:12 +00:00
|
|
|
void __sig_pending(sigset_t *) hidden;
|
2022-03-25 14:11:44 +00:00
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_CALLS_SIGNALS_INTERNAL_H_ */
|