aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib')
-rw-r--r--com32/lib/Makefile2
-rw-r--r--com32/lib/sys/sleep.c22
2 files changed, 23 insertions, 1 deletions
diff --git a/com32/lib/Makefile b/com32/lib/Makefile
index e8e89c08..2035df22 100644
--- a/com32/lib/Makefile
+++ b/com32/lib/Makefile
@@ -40,7 +40,7 @@ LIBOBJS = \
libgcc/__divdi3.o libgcc/__moddi3.o \
\
sys/intcall.o sys/farcall.o sys/cfarcall.o sys/zeroregs.o \
- sys/entry.o sys/exit.o sys/argv.o sys/times.o \
+ sys/entry.o sys/exit.o sys/argv.o sys/times.o sys/sleep.o \
sys/fileinfo.o sys/opendev.o sys/read.o sys/write.o sys/ftell.o \
sys/close.o sys/open.o sys/fileread.o sys/fileclose.o \
sys/openmem.o \
diff --git a/com32/lib/sys/sleep.c b/com32/lib/sys/sleep.c
new file mode 100644
index 00000000..8a51c1c0
--- /dev/null
+++ b/com32/lib/sys/sleep.c
@@ -0,0 +1,22 @@
+/*
+ * sys/sleep.c
+ */
+
+#include <unistd.h>
+#include <sys/times.h>
+#include <syslinux/idle.h>
+
+unsigned int msleep(unsigned int msec)
+{
+ clock_t start = times(NULL);
+
+ while (times(NULL) - start < msec)
+ syslinux_idle();
+
+ return 0;
+}
+
+unsigned int sleep(unsigned int seconds)
+{
+ return msleep(seconds * 1000);
+}