waitpid should be able to ignore kernel processes
This commit is contained in:
parent
4dfa82543e
commit
4dbade5b5a
@ -2,8 +2,9 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define WNOHANG 1
|
||||
#define WUNTRACED 2
|
||||
#define WNOHANG 0x0001
|
||||
#define WUNTRACED 0x0002
|
||||
#define WNOKERN 0x0010
|
||||
|
||||
/* This were taken from newlib, but they remain true */
|
||||
#define WIFEXITED(w) (((w) & 0xff) == 0)
|
||||
|
@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
int waitpid(int pid, int *status, int options);
|
||||
int wait(int *status);
|
||||
|
@ -775,10 +775,13 @@ void reap_process(process_t * proc) {
|
||||
}
|
||||
|
||||
static int wait_candidate(process_t * parent, int pid, int options, process_t * proc) {
|
||||
(void)options; /* there is only one option that affects candidacy, and we don't support it yet */
|
||||
|
||||
if (!proc) return 0;
|
||||
|
||||
if (options & 0x10) {
|
||||
/* Skip kernel processes */
|
||||
if (proc->is_tasklet) return 0;
|
||||
}
|
||||
|
||||
if (pid < -1) {
|
||||
if (proc->group == -pid || proc->id == -pid) return 1;
|
||||
} else if (pid == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user