mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00

It only works for sending a signal to a process that's in userspace code. We implement reception by synthesizing a PUSHA+PUSHF in the receiving process (operating on values in the TSS.) The TSS CS:EIP is then rerouted to the signal handler and a tiny return trampoline is constructed in a dedicated region in the receiving process. Also hacked up /bin/kill to be able to send arbitrary signals (kill -N PID)
18 lines
356 B
C
18 lines
356 B
C
#pragma once
|
|
|
|
#define _POSIX_VERSION 200809L
|
|
|
|
#define ALWAYS_INLINE inline __attribute__ ((always_inline))
|
|
#define __NORETURN __attribute__ ((noreturn))
|
|
#define __MALLOC __attribute__ ((malloc))
|
|
|
|
#ifdef __cplusplus
|
|
#define __BEGIN_DECLS extern "C" {
|
|
#define __END_DECLS }
|
|
#else
|
|
#define __BEGIN_DECLS
|
|
#define __END_DECLS
|
|
#endif
|
|
|
|
#undef __P
|
|
#define __P(a) a
|