]> git.corax.cc Git - corax/commitdiff
core/posixcall: Use sched_sleep() to suspend running task, instead of process_wait...
authorMatthias Kruk <m@m10k.eu>
Sat, 21 Mar 2020 09:12:32 +0000 (18:12 +0900)
committerMatthias Kruk <m@m10k.eu>
Sat, 21 Mar 2020 09:12:32 +0000 (18:12 +0900)
kernel/core/posixcall.c

index 2f47e9fd145b7c75a3b0272ce419b400feed6149..faea3aa5c196d12a4891f7c230c0a15828c3180d 100644 (file)
@@ -9,6 +9,7 @@
 #include <process.h>
 #include <debug.h>
 #include <string.h>
+#include <sched.h>
 
 int sys_sigaction(stack_frame_t*);
 
@@ -312,7 +313,8 @@ int sys_wait(int *status)
        /* wait for a signal from any process */
        dbg_printf("[%u] going to wait\n", self);
 
-       ret_val = process_wait(-1);
+       /* FIXME: Who is going to wake up the task? */
+       ret_val = sched_sleep(NULL);
 
        /* TODO: Handle the signal */
 
@@ -417,7 +419,7 @@ int sys_debug(const char *str, const u32_t len)
        cproc = process_get_current();
        ret_val = len < (sizeof(buffer) - 1) ? len : (sizeof(buffer) - 1);
 
-       process_memcpy_ptok(cproc, buffer, str, ret_val);
+       process_memcpy_ptok(cproc, buffer, (void*)str, ret_val);
        buffer[ret_val] = 0;
 
        dbg_printf("%s\n", buffer);