Miscellaneous calls
[reactos.git] / posix / lib / psxdll / unistd / sleep.c
1 /* $Id: sleep.c,v 1.1 2002/05/17 02:16:16 hyperion Exp $
2 */
3 /*
4 * COPYRIGHT: See COPYING in the top level directory
5 * PROJECT: ReactOS POSIX+ Subsystem
6 * FILE: subsys/psx/lib/psxdll/unistd/sleep.c
7 * PURPOSE: Suspend execution for an interval of time
8 * PROGRAMMER: KJK::Hyperion <noog@libero.it>
9 * UPDATE HISTORY:
10 * 14/05/2002: Created
11 */
12
13 #include <ddk/ntddk.h>
14 #include <unistd.h>
15
16 unsigned int sleep(unsigned int seconds)
17 {
18 LARGE_INTEGER lnDelay = RtlEnlargedIntegerMultiply(seconds, 10000000);
19
20 if(!NT_SUCCESS(NtDelayExecution(FALSE, &lnDelay)))
21 return seconds;
22
23 return 0;
24 }
25
26 /* EOF */
27