summaryrefslogtreecommitdiff
path: root/kernel/syscalls.c
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-28 01:52:07 +0200
committerMiguel <m.i@gmx.at>2018-09-28 01:52:07 +0200
commit4ddca59e2c07a98988ffb07571d2b35c4c90f5ac (patch)
tree6ee7ea0f8c7c6190433d45fd1714aef8e39a1a39 /kernel/syscalls.c
parent9a29d452d03a63f39a80c0640b7747d8508568e2 (diff)
reactiveate threads. allow user space access to framebuffer
Diffstat (limited to 'kernel/syscalls.c')
-rw-r--r--kernel/syscalls.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/syscalls.c b/kernel/syscalls.c
index d289121..01bc7a5 100644
--- a/kernel/syscalls.c
+++ b/kernel/syscalls.c
@@ -302,7 +302,16 @@ uint32_t syscall_fork(int none1, int none2, int none3, int pid)
uint32_t syscall_clone(int none1, int none2, int none3, int pid)
{
- return task_clone(pid);
+ uint32_t newpid=task_clone(pid);
+
+ for(int i=0;i<MAX_FD;i++) // TODO: use same pid and use same list maybe?
+ {
+ if(!open_fd[pid][i])continue;
+ fds[newpid][i]=fd_dupl(&fds[pid][i]);
+ open_fd[newpid][i]=true;
+ }
+
+ return newpid;
}
uint32_t syscall_wait(int none1, int none2, int none3, int pid)