Implement schedsleep() syscall to sleep a process for a given time
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user