Implement schedsleep() syscall to sleep a process for a given time

This commit is contained in:
2025-11-02 16:46:37 +01:00
parent 179c4b98e2
commit 0f93aa2a81
9 changed files with 29 additions and 6 deletions

View File

@ -1,7 +1,19 @@
#include <ulib.h>
void diagdummy_block(void) {
uprintf("blocking...\n");
while(1) {
unsigned long ms = 0;
if (argslen() > 1) {
char *strms = *(args()+1);
char *endp;
ms = string_conv_strtoul(strms, &endp, 10);
}
if (ms == 0) {
uprintf("blocking...\n");
while(1) {
}
} else {
uprintf("ms = %lu\n", ms);
schedsleep(ms);
}
}