X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/ec4ff182252b6d7b3cb81f4fa783c5348a6c30fd..refs/heads/cor/lrud:/lunaix-os/kernel/process/sched.c diff --git a/lunaix-os/kernel/process/sched.c b/lunaix-os/kernel/process/sched.c index 112741c..ccf0e45 100644 --- a/lunaix-os/kernel/process/sched.c +++ b/lunaix-os/kernel/process/sched.c @@ -224,33 +224,6 @@ done: fail("unexpected return from scheduler"); } -__DEFINE_LXSYSCALL1(unsigned int, sleep, unsigned int, seconds) -{ - if (!seconds) { - return 0; - } - - time_t systime = clock_systime() / 1000; - struct haybed* bed = ¤t_thread->sleep; - - if (bed->wakeup_time) { - return (bed->wakeup_time - systime); - } - - bed->wakeup_time = systime + seconds; - - if (llist_empty(&bed->sleepers)) { - llist_append(&sched_ctx.sleepers, &bed->sleepers); - } - - store_retval(seconds); - - block_current_thread(); - schedule(); - - return 0; -} - __DEFINE_LXSYSCALL1(unsigned int, alarm, unsigned int, seconds) { struct haybed* bed = ¤t_thread->sleep; @@ -396,7 +369,7 @@ alloc_process() proc->root = vfs_sysroot; proc->sigreg = vzalloc(sizeof(struct sigregistry)); - proc->fdtable = vzalloc(sizeof(struct v_fdtable)); + proc->fdtable = fdtable_create(); proc->mm = procvm_create(proc); @@ -632,4 +605,5 @@ orphaned_proc(pid_t pid) // 如果其父进程的状态是terminated 或 destroy中的一种 // 或者其父进程是在该进程之后创建的,那么该进程为孤儿进程 return proc_terminated(parent) || parent->created > proc->created; -} \ No newline at end of file +} +