headers/bsd: Add sys/queue.h.
[haiku.git] / src / system / libroot / posix / unistd / usleep.c
blob8e52f68890101cdcd5356f0169843fb0accb76ea
1 /*
2 ** Copyright 2001, Manuel J. Petit. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
6 #include <unistd.h>
7 #include <syscalls.h>
8 #include <errno.h>
10 #include <errno_private.h>
13 int
14 usleep(unsigned useconds)
16 int err;
17 err = snooze_until(system_time() + (bigtime_t)(useconds), B_SYSTEM_TIMEBASE);
18 if (err < 0) {
19 __set_errno(err);
20 return -1;
22 return 0;