diff options
author | dzwdz | 2023-09-25 00:12:57 +0200 |
---|---|---|
committer | dzwdz | 2023-09-25 00:12:57 +0200 |
commit | 2c78dc983d09e136dd016ae6ecee6b191e033de1 (patch) | |
tree | fa3f0c858a0c1b61d00d4a7474e80b1aa0368bbf /src/kernel/proc.c | |
parent | 16138fc20fc9c472af37fb8385a997a0d9202f32 (diff) |
kernel/intr: accept a message, allow killing processes via intrs
Diffstat (limited to 'src/kernel/proc.c')
-rw-r--r-- | src/kernel/proc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c index 0ce0f50..dc17af2 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -382,7 +382,14 @@ void proc_tryintr(Proc *p) { } } -void proc_intr(Proc *p) { +void proc_intr(Proc *p, const char *buf, size_t len) { + assert(buf != NULL || len == 0); + + if (4 <= len && memcmp(buf, "kill", 4) == 0) { + proc_kill(p, EINTR); + return; + } + if (!p->intr_fn) return; proc_tryintr(p); |