diff options
Diffstat (limited to 'os/utils.c')
-rw-r--r-- | os/utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/os/utils.c b/os/utils.c index e605a6c7a..dd5acd34b 100644 --- a/os/utils.c +++ b/os/utils.c @@ -64,6 +64,10 @@ OR PERFORMANCE OF THIS SOFTWARE. #include <X11/Xos.h> #include <stdio.h> #include <time.h> +#if !defined(WIN32) || !defined(__MINGW32__) +#include <sys/time.h> +#include <sys/resource.h> +#endif #include "misc.h" #include <X11/X.h> #define XSERV_t @@ -525,6 +529,13 @@ GiveUp(int sig) errno = olderrno; } +#if defined WIN32 && defined __MINGW32__ +_X_EXPORT CARD32 +GetTimeInMillis (void) +{ + return GetTickCount (); +} +#else _X_EXPORT CARD32 GetTimeInMillis(void) { @@ -539,6 +550,7 @@ GetTimeInMillis(void) X_GETTIMEOFDAY(&tv); return(tv.tv_sec * 1000) + (tv.tv_usec / 1000); } +#endif _X_EXPORT void AdjustWaitForDelay (pointer waitTime, unsigned long newdelay) @@ -795,7 +807,15 @@ ProcessCommandLine(int argc, char *argv[]) UseMsg(); } else if ( strcmp( argv[i], "-core") == 0) + { CoreDump = TRUE; +#if !defined(WIN32) || !defined(__MINGW32__) + struct rlimit core_limit; + getrlimit (RLIMIT_CORE, &core_limit); + core_limit.rlim_cur = core_limit.rlim_max; + setrlimit (RLIMIT_CORE, &core_limit); +#endif + } else if ( strcmp( argv[i], "-dpi") == 0) { if(++i < argc) |