diff options
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c index 63c57de26..6e2d6e1e3 100644 --- a/src/utils.c +++ b/src/utils.c @@ -18,8 +18,13 @@ #include "utils.h" +#include <stdlib.h> #include <string.h> #include <ctype.h> +#include <sys/select.h> +#include <sys/time.h> +#include <sys/types.h> +#include <unistd.h> char * myFgets(char * buffer, int bufferSize, FILE * fp) { char * ret = fgets(buffer,bufferSize,fp); @@ -43,3 +48,12 @@ void stripReturnChar(char * string) { *string = ' '; } } + +void my_usleep(long usec) { + struct timeval tv; + + tv.tv_sec = 0; + tv.tv_usec = usec; + + select(0,NULL,NULL,NULL,&tv); +} |