X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/eb251af8672e033f29322253f136e09c76f2b0a3..77e7b21f117eecd04bb31257ee68dfc1f425a47e:/lunaix-os/kernel/sched.c diff --git a/lunaix-os/kernel/sched.c b/lunaix-os/kernel/sched.c index 8e089d6..ee596b1 100644 --- a/lunaix-os/kernel/sched.c +++ b/lunaix-os/kernel/sched.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -267,6 +268,7 @@ alloc_process() proc->pid = i; proc->created = clock_systime(); proc->pgid = proc->pid; + proc->fdtable = vzalloc(sizeof(struct v_fdtable)); llist_init_head(&proc->mm.regions); llist_init_head(&proc->children); @@ -282,7 +284,7 @@ commit_process(struct proc_info* process) assert(process == &sched_ctx._procs[process->pid]); if (process->state != PS_CREATED) { - __current->k_status = LXINVL; + __current->k_status = EINVAL; return; } @@ -305,7 +307,7 @@ destroy_process(pid_t pid) { int index = pid; if (index <= 0 || index > sched_ctx.ptable_len) { - __current->k_status = LXINVLDPID; + __current->k_status = EINVAL; return; } struct proc_info* proc = &sched_ctx._procs[index];