From 531b6e2081c980cc03b21df516ccf5486a03efbc Mon Sep 17 00:00:00 2001 From: ph649mxes <1347377011@qq.com> Date: Sat, 25 Jun 2022 17:30:46 +0800 Subject: [PATCH] ADD file via upload --- sleep2.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 sleep2.c diff --git a/sleep2.c b/sleep2.c new file mode 100644 index 0000000..dce5b7c --- /dev/null +++ b/sleep2.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