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
fix: refining the tty input
[lunaix-os.git]
/
lunaix-os
/
kernel
/
sched.c
diff --git
a/lunaix-os/kernel/sched.c
b/lunaix-os/kernel/sched.c
index ee596b17c7d67d4b63f3c607ea4ba15f4b815513..be9952519fe282993a29154123c89a90f8d7b249 100644
(file)
--- a/
lunaix-os/kernel/sched.c
+++ b/
lunaix-os/kernel/sched.c
@@
-203,6
+203,11
@@
__DEFINE_LXSYSCALL3(pid_t, waitpid, pid_t, pid, int*, status, int, options)
return _wait(pid, status, options);
}
return _wait(pid, status, options);
}
+__DEFINE_LXSYSCALL(int, geterrno)
+{
+ return __current->k_status;
+}
+
pid_t
_wait(pid_t wpid, int* status, int options)
{
pid_t
_wait(pid_t wpid, int* status, int options)
{
@@
-314,6
+319,14
@@
destroy_process(pid_t pid)
proc->state = PS_DESTROY;
llist_delete(&proc->siblings);
proc->state = PS_DESTROY;
llist_delete(&proc->siblings);
+ for (size_t i = 0; i < VFS_MAX_FD; i++) {
+ struct v_fd* fd = proc->fdtable->fds[i];
+ if (fd)
+ vfs_close(fd->file);
+ }
+
+ vfree(proc->fdtable);
+
struct mm_region *pos, *n;
llist_for_each(pos, n, &proc->mm.regions.head, head)
{
struct mm_region *pos, *n;
llist_for_each(pos, n, &proc->mm.regions.head, head)
{