Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / network / stacks / AROSTCP / netlib / usleep.c
blob0ab5632f35184656c9aa348ad4708cee8766beed
1 /* $Id$
3 * usleep.c - suspend process for the specified time
5 * Copyright © 1994 AmiTCP/IP Group,
6 * Network Solutions Development Inc.
7 * All rights reserved.
8 */
10 #include <sys/param.h>
11 #include <unistd.h>
12 #include <sys/time.h>
13 #include <sys/socket.h>
15 /****** net.lib/usleep *********************************************
17 NAME
18 usleep - suspend process execution for the specified time
20 SYNOPSIS
21 void usleep(unsigned int microseconds);
23 FUNCTION
24 Process execution is suspended for number of microseconds
25 specified in 'microseconds'. The sleep will be aborted if any
26 of the break signals specified for the process is received
27 (only CTRL-C by default).
29 PORTABILITY
30 UNIX
32 INPUTS
33 'microseconds' - number of microseconds to sleep.
35 RESULT
36 Does not return a value.
38 NOTES
39 The sleep is implemented as a single select() call with all other
40 than time out argument as NULL.
42 SEE ALSO
43 bsdsocket.library/select()
45 *****************************************************************************
49 void usleep(unsigned int usecs)
51 struct timeval tv;
53 tv.tv_sec = 0;
54 while (usecs >= 1000000) {
55 usecs -= 1000000;
56 tv.tv_sec++;
58 tv.tv_usec = usecs;
59 select(0, 0, 0, 0, &tv);