StdLib|LibC: Implement the sleep() function.

Implement the sleep() function and make both sleep() and usleep() public.  Required initially for Python, but these functions have general applicability.

Signed-off-by: duanev@gmail.com
Reviewed-by:   darylm503


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12323 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
darylm503
2011-09-11 20:09:02 +00:00
parent 6c0ebd5f2f
commit 5252c2920c
2 changed files with 16 additions and 15 deletions

View File

@@ -74,19 +74,14 @@
#define MAX_SLEEP_DELAY 0xfffffffe
//
// Name:
// usleep
//
// Description:
// Implement usleep(3) function.
//
// Arguments:
// Microseconds to sleep.
//
// Returns:
// 0
//
/** Sleep for the specified number of Microseconds.
Implements the usleep(3) function.
@param[in] Microseconds Number of microseconds to sleep.
@retval 0 Always returns zero.
**/
int
usleep( useconds_t Microseconds )
{
@@ -98,6 +93,12 @@ usleep( useconds_t Microseconds )
return (0);
}
unsigned int
sleep( unsigned int Seconds )
{
return (usleep( useconds_t(Seconds * 1000000) ));
}
static int
selscan(
fd_mask **ibits,