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