2022-03-25 07:11:44 -07:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_CALLS_SIGNALS_INTERNAL_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_CALLS_SIGNALS_INTERNAL_H_
|
|
|
|
#include "libc/calls/struct/sigset.h"
|
2022-04-12 05:20:17 -07:00
|
|
|
#include "libc/calls/ucontext.h"
|
2023-09-08 01:49:41 -07:00
|
|
|
#include "libc/nt/struct/context.h"
|
2022-03-25 07:11:44 -07:00
|
|
|
|
2022-10-13 13:44:41 -07:00
|
|
|
#define __SIG_QUEUE_LENGTH 32
|
2023-08-19 06:41:06 -07:00
|
|
|
#define __SIG_POLLING_INTERVAL_MS 20
|
2022-04-12 05:20:17 -07:00
|
|
|
#define __SIG_LOGGING_INTERVAL_MS 1700
|
2022-03-25 07:11:44 -07:00
|
|
|
|
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
2023-09-08 01:49:41 -07:00
|
|
|
struct Delivery {
|
|
|
|
int ops;
|
|
|
|
int sig;
|
|
|
|
int sic;
|
|
|
|
struct NtContext *nc;
|
|
|
|
};
|
|
|
|
|
2022-04-12 08:05:22 -07:00
|
|
|
struct Signals {
|
2023-09-12 11:38:34 -07:00
|
|
|
uint64_t mask;
|
|
|
|
uint64_t pending;
|
|
|
|
uint64_t count;
|
2022-04-12 08:05:22 -07:00
|
|
|
};
|
|
|
|
|
2022-06-11 01:59:26 -07:00
|
|
|
extern struct Signals __sig;
|
2022-04-12 08:05:22 -07:00
|
|
|
|
2023-07-30 08:55:01 -07:00
|
|
|
bool __sig_check(int);
|
2023-09-08 01:49:41 -07:00
|
|
|
bool __sig_is_core(int);
|
2023-09-12 11:38:34 -07:00
|
|
|
bool __sig_is_ignored(int);
|
2023-07-30 08:55:01 -07:00
|
|
|
bool __sig_handle(int, int, int, ucontext_t *);
|
2023-07-24 08:31:54 -07:00
|
|
|
int __sig_mask(int, const sigset_t *, sigset_t *);
|
2023-09-08 01:49:41 -07:00
|
|
|
bool __sig_deliver(int, int, int, ucontext_t *);
|
|
|
|
int __sig_tramp(struct Delivery *);
|
2023-09-10 11:52:03 -07:00
|
|
|
bool32 __sig_notify(int, int);
|
2022-03-25 07:11:44 -07:00
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_CALLS_SIGNALS_INTERNAL_H_ */
|