diff --git a/libsrc/common/.cvsignore b/libsrc/common/.cvsignore index 6038dd9e4..76d1d0b75 100644 --- a/libsrc/common/.cvsignore +++ b/libsrc/common/.cvsignore @@ -29,6 +29,7 @@ puts.s qsort.s realloc.s rewind.s +sleep.s sscanf.s strftime.s strtok.s diff --git a/libsrc/common/Makefile b/libsrc/common/Makefile index 52b460c88..273dec7dc 100644 --- a/libsrc/common/Makefile +++ b/libsrc/common/Makefile @@ -47,6 +47,7 @@ C_OBJS = _afailed.o \ qsort.o \ realloc.o \ rewind.o \ + sleep.o \ sscanf.o \ strftime.o \ strxfrm.o \ diff --git a/libsrc/common/sleep.c b/libsrc/common/sleep.c new file mode 100644 index 000000000..cbff4fbff --- /dev/null +++ b/libsrc/common/sleep.c @@ -0,0 +1,23 @@ +/* + * sleep.c + * + * Stefan Haubenthal, 2003-06-11 + * Ullrich von Bassewitz, 2003-06-12 + * + */ + + + +#include + + + +unsigned sleep (unsigned wait) +{ + clock_t goal = clock () + ((clock_t) wait) * CLOCKS_PER_SEC; + while ((long) (goal - clock ()) > 0) ; + return 0; +} + + +