Created
August 21, 2017 05:17
-
-
Save mlouielu/68b18d19ea672a8e6d0922b7072f5c7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <kernel/syscalls.h> | |
#include "sh.h" | |
int _sleep(int ms) { | |
return do_syscall1((void *) ms, SYS_MSLEEP); | |
} | |
int sleep(int argc, char *argv[]) { | |
int ms; | |
if (argc == 2) | |
ms = atoi(argv[1]); | |
else | |
return 0; | |
printk("Hello\n"); | |
_sleep(ms); | |
printk("Wake up\n"); | |
return 0; | |
} | |
HOOK_BUILTIN_CMD(sleep, sleep); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment