summaryrefslogtreecommitdiffstats
path: root/StdLib/LibC
diff options
context:
space:
mode:
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-11 20:09:02 +0000
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-11 20:09:02 +0000
commit5252c2920ce5487221f7ce1f902f040578317194 (patch)
tree9d4d87941ff694cea165359922d9387594c490db /StdLib/LibC
parent6c0ebd5f2f53d5c4d6a91fd0b9148ba23e730c39 (diff)
downloadedk2-5252c2920ce5487221f7ce1f902f040578317194.tar.gz
edk2-5252c2920ce5487221f7ce1f902f040578317194.tar.bz2
edk2-5252c2920ce5487221f7ce1f902f040578317194.zip
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
Diffstat (limited to 'StdLib/LibC')
-rw-r--r--StdLib/LibC/Uefi/select.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/StdLib/LibC/Uefi/select.c b/StdLib/LibC/Uefi/select.c
index 8da03e65d0..830e011e0d 100644
--- a/StdLib/LibC/Uefi/select.c
+++ b/StdLib/LibC/Uefi/select.c
@@ -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,