From 5373b97d0a216952ab247acf3ca2c82aeb8a8279 Mon Sep 17 00:00:00 2001 From: ph649mxes <1347377011@qq.com> Date: Thu, 23 Jun 2022 11:17:12 +0800 Subject: [PATCH] ADD file via upload --- sleep.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 sleep.c diff --git a/sleep.c b/sleep.c new file mode 100644 index 0000000..dce5b7c --- /dev/null +++ b/sleep.c @@ -0,0 +1,21 @@ +#define __LIBRARY__ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +int sys_sleep(unsigned int seconds) { + + sys_signal(SIGALRM, SIG_IGN); /* �źŴ����������ΪSIG_IGN�������Ի����ź� */ + sys_alarm(seconds); /* seconds�����������źţ����ѽ��� */ + + if (sys_pause() != -1) /* �ٴν���˯�� */ + return 0; + return -1; +} \ No newline at end of file