--- libaitio/src/Attic/tools.c 2012/08/01 00:37:08 1.17 +++ libaitio/src/Attic/tools.c 2012/09/19 15:19:53 1.18 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: tools.c,v 1.17 2012/08/01 00:37:08 misho Exp $ +* $Id: tools.c,v 1.18 2012/09/19 15:19:53 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -638,4 +638,18 @@ io_gethostbyname(const char *psHost, u_short port, io_ } return NULL; +} + +/* + * io_usleep() - usleep() replacement for ELWIX + * + * @usec = microseconds for sleep + * return: -1 interrupted by signal or 0 ok + */ +inline int +io_usleep(u_int usec) +{ + struct timeval tv = { (time_t) (usec / 1000000), (long) (usec % 1000000) }; + + return select(0, NULL, NULL, NULL, &tv); }