From: Matthias Kruk Date: Sat, 21 Mar 2020 09:12:32 +0000 (+0900) Subject: core/posixcall: Use sched_sleep() to suspend running task, instead of process_wait... X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=d6808b435176a96a673d159301d972a939802997;p=corax core/posixcall: Use sched_sleep() to suspend running task, instead of process_wait(), fix compiler warning --- diff --git a/kernel/core/posixcall.c b/kernel/core/posixcall.c index 2f47e9f..faea3aa 100644 --- a/kernel/core/posixcall.c +++ b/kernel/core/posixcall.c @@ -9,6 +9,7 @@ #include #include #include +#include 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);