aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2006-12-20 03:14:59 +0000
committerMichael Brown <mcb30@etherboot.org>2006-12-20 03:14:59 +0000
commit637a891264f4f81533e58f1b5ed850324ddfb134 (patch)
treee55e8a1efd01af1618a75ebeb93f873fb06c4a11
parent1e322d4b4cc88111ad3a71f8201899c12e96ce1e (diff)
downloadipxe-637a891264f4f81533e58f1b5ed850324ddfb134.tar.gz
Fix prototype of sleep() and move it to unistd.h
-rw-r--r--src/core/misc.c5
-rw-r--r--src/include/etherboot.h2
-rw-r--r--src/include/unistd.h1
3 files changed, 5 insertions, 3 deletions
diff --git a/src/core/misc.c b/src/core/misc.c
index c80eacdde..3930d265a 100644
--- a/src/core/misc.c
+++ b/src/core/misc.c
@@ -75,12 +75,13 @@ int32_t random(void)
/**************************************************************************
SLEEP
**************************************************************************/
-void sleep(int secs)
+unsigned int sleep(unsigned int secs)
{
unsigned long tmo;
for (tmo = currticks()+secs*TICKS_PER_SEC; currticks() < tmo; ) {
}
+ return 0;
}
/**************************************************************************
@@ -89,7 +90,7 @@ INTERRUPTIBLE SLEEP
void interruptible_sleep(int secs)
{
printf("<sleep>\n");
- return sleep(secs);
+ sleep(secs);
}
/**************************************************************************
diff --git a/src/include/etherboot.h b/src/include/etherboot.h
index e5a181536..b26379c26 100644
--- a/src/include/etherboot.h
+++ b/src/include/etherboot.h
@@ -9,6 +9,7 @@
#include "compiler.h"
#include "stddef.h"
#include "stdint.h"
+#include <unistd.h>
/*
@@ -220,7 +221,6 @@ extern int load_block P((unsigned char *, unsigned int, unsigned int, int ));
/* misc.c */
extern void twiddle P((void));
-extern void sleep P((int secs));
extern void interruptible_sleep P((int secs));
extern int strcasecmp P((const char *a, const char *b));
extern char *substr P((const char *a, const char *b));
diff --git a/src/include/unistd.h b/src/include/unistd.h
index f3412d400..35dcf5845 100644
--- a/src/include/unistd.h
+++ b/src/include/unistd.h
@@ -4,6 +4,7 @@
#include <stddef.h>
#include <stdarg.h>
+extern unsigned int sleep ( unsigned int seconds );
extern int execv ( const char *command, char * const argv[] );
/**