+
+ if (i == sched_ctx.ptable_len) {
+ sched_ctx.ptable_len++;
+ }
+
+ struct proc_info* proc = &sched_ctx._procs[i];
+ memset(proc, 0, sizeof(*proc));
+
+ proc->state = PS_CREATED;
+ proc->pid = i;
+ proc->created = clock_systime();
+ proc->pgid = proc->pid;
+ proc->fdtable = vzalloc(sizeof(struct v_fdtable));
+
+ llist_init_head(&proc->mm.regions.head);
+ llist_init_head(&proc->children);
+ llist_init_head(&proc->grp_member);
+ llist_init_head(&proc->sleep.sleepers);
+
+ return proc;