mirror of https://github.com/ipxe/ipxe.git
Fix prototype of sleep() and move it to unistd.h
parent
1e322d4b4c
commit
637a891264
|
@ -75,12 +75,13 @@ int32_t random(void)
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
SLEEP
|
SLEEP
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
void sleep(int secs)
|
unsigned int sleep(unsigned int secs)
|
||||||
{
|
{
|
||||||
unsigned long tmo;
|
unsigned long tmo;
|
||||||
|
|
||||||
for (tmo = currticks()+secs*TICKS_PER_SEC; currticks() < tmo; ) {
|
for (tmo = currticks()+secs*TICKS_PER_SEC; currticks() < tmo; ) {
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -89,7 +90,7 @@ INTERRUPTIBLE SLEEP
|
||||||
void interruptible_sleep(int secs)
|
void interruptible_sleep(int secs)
|
||||||
{
|
{
|
||||||
printf("<sleep>\n");
|
printf("<sleep>\n");
|
||||||
return sleep(secs);
|
sleep(secs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "compiler.h"
|
#include "compiler.h"
|
||||||
#include "stddef.h"
|
#include "stddef.h"
|
||||||
#include "stdint.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 */
|
/* misc.c */
|
||||||
extern void twiddle P((void));
|
extern void twiddle P((void));
|
||||||
extern void sleep P((int secs));
|
|
||||||
extern void interruptible_sleep P((int secs));
|
extern void interruptible_sleep P((int secs));
|
||||||
extern int strcasecmp P((const char *a, const char *b));
|
extern int strcasecmp P((const char *a, const char *b));
|
||||||
extern char *substr P((const char *a, const char *b));
|
extern char *substr P((const char *a, const char *b));
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
extern unsigned int sleep ( unsigned int seconds );
|
||||||
extern int execv ( const char *command, char * const argv[] );
|
extern int execv ( const char *command, char * const argv[] );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue