Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "tool_setup.h"
00023
00024 #ifdef HAVE_SYS_SELECT_H
00025 # include <sys/select.h>
00026 #endif
00027
00028 #ifdef HAVE_SYS_POLL_H
00029 # include <sys/poll.h>
00030 #elif defined(HAVE_POLL_H)
00031 # include <poll.h>
00032 #endif
00033
00034 #ifdef MSDOS
00035 # include <dos.h>
00036 #endif
00037
00038 #include "tool_sleep.h"
00039
00040 #include "memdebug.h"
00041
00042 void tool_go_sleep(long ms)
00043 {
00044 #if defined(MSDOS)
00045 delay(ms);
00046 #elif defined(WIN32)
00047 Sleep(ms);
00048 #elif defined(HAVE_POLL_FINE)
00049 (void)poll((void *)0, 0, (int)ms);
00050 #else
00051 struct timeval timeout;
00052 timeout.tv_sec = ms / 1000L;
00053 ms = ms % 1000L;
00054 timeout.tv_usec = ms * 1000L;
00055 select(0, NULL, NULL, NULL, &timeout);
00056 #endif
00057 }
00058