diff --git a/mysystem_call.c b/mysystem_call.c index 742f2fa..0a26de5 100644 --- a/mysystem_call.c +++ b/mysystem_call.c @@ -86,6 +86,21 @@ long sys_getcwd(char *buf,size_t size) return 0; } int sys_sleep(unsigned int seconds) +{ + sys_signal(SIGALRM,SIG_IGN); + sys_alarm(seconds); + if(sys_pause()!=-1) + { + printk("sleep\n"); + return 0; + } + + + printk("do not sleep\n"); + return -1; +} + +int sys_something() { return 0; } \ No newline at end of file