From c38b7e971d5bcb2c7aeeae381930a3c5b98050b2 Mon Sep 17 00:00:00 2001 From: plem76i95 <429816665@qq.com> Date: Thu, 23 Jun 2022 17:21:02 +0800 Subject: [PATCH] sys_sleep finished --- myfunction.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 myfunction.c diff --git a/myfunction.c b/myfunction.c new file mode 100644 index 0000000..39d6b18 --- /dev/null +++ b/myfunction.c @@ -0,0 +1,46 @@ + + +#define _LIBRARY_ +#include +#include +#include +#include +#include + +int sys_sleep(unsigned int seconds); +int sys_execve2(const char *path, char * argv[], char * envp[]) +{ + return 0; +} + + + + +int sys_getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int count) + +{ + return 0; +} + + + +int sys_pipe2(void) +{ + return 0; +} + + +int sys_sleep(unsigned int seconds) +{ + long s = sys_signal(SIGALRM,SIG_IGN,NULL); + if (s <0) return -1; + int c = sys_alarm(seconds); + pause(); + return 0; +} + + +long sys_getcwd(char * buf, size_t size) +{ + return 0; +}