git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: open(2), close(2), mkdir(2) and readdir(2) syscall
[lunaix-os.git]
/
lunaix-os
/
kernel
/
sched.c
diff --git
a/lunaix-os/kernel/sched.c
b/lunaix-os/kernel/sched.c
index 8e089d64b976be61ddf22fb77259caf9dea54f5b..ee596b17c7d67d4b63f3c607ea4ba15f4b815513 100644
(file)
--- a/
lunaix-os/kernel/sched.c
+++ b/
lunaix-os/kernel/sched.c
@@
-6,6
+6,7
@@
#include <lunaix/mm/kalloc.h>
#include <lunaix/mm/pmm.h>
#include <lunaix/mm/kalloc.h>
#include <lunaix/mm/pmm.h>
+#include <lunaix/mm/valloc.h>
#include <lunaix/mm/vmm.h>
#include <lunaix/process.h>
#include <lunaix/sched.h>
#include <lunaix/mm/vmm.h>
#include <lunaix/process.h>
#include <lunaix/sched.h>
@@
-267,6
+268,7
@@
alloc_process()
proc->pid = i;
proc->created = clock_systime();
proc->pgid = proc->pid;
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);
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) {
assert(process == &sched_ctx._procs[process->pid]);
if (process->state != PS_CREATED) {
- __current->k_status =
LXINV
L;
+ __current->k_status =
EINVA
L;
return;
}
return;
}
@@
-305,7
+307,7
@@
destroy_process(pid_t pid)
{
int index = pid;
if (index <= 0 || index > sched_ctx.ptable_len) {
{
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];
return;
}
struct proc_info* proc = &sched_ctx._procs[index];