diff options
| author | Michael Brown | 2006-12-20 04:14:59 +0100 |
|---|---|---|
| committer | Michael Brown | 2006-12-20 04:14:59 +0100 |
| commit | 637a891264f4f81533e58f1b5ed850324ddfb134 (patch) | |
| tree | e55e8a1efd01af1618a75ebeb93f873fb06c4a11 | |
| parent | Add (partly-functional) user interface for editing configuration settings (diff) | |
| download | ipxe-637a891264f4f81533e58f1b5ed850324ddfb134.tar.gz ipxe-637a891264f4f81533e58f1b5ed850324ddfb134.tar.xz ipxe-637a891264f4f81533e58f1b5ed850324ddfb134.zip | |
Fix prototype of sleep() and move it to unistd.h
| -rw-r--r-- | src/core/misc.c | 5 | ||||
| -rw-r--r-- | src/include/etherboot.h | 2 | ||||
| -rw-r--r-- | src/include/unistd.h | 1 |
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[] ); /** |
