summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.c
diff options
context:
space:
mode:
authordzwdz2022-09-02 14:44:52 +0200
committerdzwdz2022-09-02 17:58:47 +0200
commitc16d956c0dd3d69748f7208e09bb69a6df8c6483 (patch)
tree38089f4b9e7fb153aa817e25340b7107f7cdf795 /src/kernel/syscalls.c
parent41a15bd16806261d66d55bbb85034553cd58361e (diff)
kernel/proc: introduce child ids for telling children apart
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r--src/kernel/syscalls.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 37a0ce3..62acf5f 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -76,7 +76,7 @@ long _syscall_fork(int flags, handle_t __user *fs_front) {
virt_cpy_to(process_current->pages, fs_front, &hid, sizeof hid);
}
}
- SYSCALL_RETURN(1);
+ SYSCALL_RETURN(child->cid);
}
handle_t _syscall_open(const char __user *path, long len, int flags) {
@@ -379,12 +379,13 @@ long _syscall_execbuf(void __user *ubuf, size_t len) {
}
void _syscall_debug_klog(const void __user *buf, size_t len) {
- (void)buf; (void)len;
- // static char kbuf[256];
- // if (len >= sizeof(kbuf)) len = sizeof(kbuf) - 1;
- // virt_cpy_from(process_current->pages, kbuf, buf, len);
- // kbuf[len] = '\0';
- // kprintf("[klog] %x\t%s\n", process_current->id, kbuf);
+ if (false) {
+ static char kbuf[256];
+ if (len >= sizeof(kbuf)) len = sizeof(kbuf) - 1;
+ virt_cpy_from(process_current->pages, kbuf, buf, len);
+ kbuf[len] = '\0';
+ kprintf("[klog] %x\t%s\n", process_current->globalid, kbuf);
+ }
}
long _syscall(long num, long a, long b, long c, long d, long e) {