MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / kill

Method kill

source/kernel/ksystem.cpp:335–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335U32 KSystem::kill(S32 pid, U32 signal) {
336 KProcessPtr process;
337 {
338 BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(processesCond);
339
340 if (pid>0) {
341 process = KSystem::processes[pid];
342 } else if (pid == 0 || pid == -1) {
343 kpanic_fmt("kill with pid = %d not implemented", pid);
344 } else {
345 process = KSystem::processes[-pid];
346 }
347 if (!process) {
348 return -K_ESRCH;
349 }
350 }
351 if (signal!=0) {
352 return process->signal(signal);
353 }
354 return 0;
355}
356
357void KSystem::wakeThreadsWaitingOnProcessStateChanged() {
358 BOXEDWINE_CONDITION_SIGNAL_ALL(processesCond);

Callers

nothing calls this directly

Calls 2

kpanic_fmtFunction · 0.85
signalMethod · 0.45

Tested by

no test coverage detected