X-Git-Url: https://git.jankratochvil.net/?p=mdsms.git;a=blobdiff_plain;f=usleep.c;fp=usleep.c;h=ecbd1045f6726ba83e65325ab50d4ee3ee17cc31;hp=0000000000000000000000000000000000000000;hb=3b014e78c3dff6daa5ba9b60fb34aa8d3f1e3e01;hpb=e622d224927f061c72126c61cc1c2185914320fd diff --git a/usleep.c b/usleep.c new file mode 100644 index 0000000..ecbd104 --- /dev/null +++ b/usleep.c @@ -0,0 +1,27 @@ +#include "config.h" +#ifndef lint +static char rcsid[] ATTR_UNUSED = "$Id$"; +#endif + +/* This part of code is a public domain */ + +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + +/* CONFORMING TO BSD 4.3 */ + +void usleep(unsigned long usec) +{ +struct timeval tv; + + tv.tv_sec =usec/1000000; + tv.tv_usec=usec%1000000; + select(0,NULL,NULL,NULL,&tv); +}