Commit a74dc1a1 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Use the monotonic time counter also on the server side.

parent a8df9b14
DEFS = -D__WINESRC__
EXTRALIBS = @LIBPOLL@
EXTRALIBS = @LIBPOLL@ @LIBRT@
C_SRCS = \
async.c \
......@@ -62,10 +62,10 @@ all: $(PROGRAMS)
@MAKE_RULES@
wineserver: $(OBJS)
$(CC) -o $@ $(OBJS) $(LIBWINE) $(LIBPORT) $(LDFLAGS) $(LIBS) $(LDRPATH_LOCAL)
$(CC) -o $@ $(OBJS) $(LIBWINE) $(LIBPORT) $(LDFLAGS) $(EXTRALIBS) $(LIBS) $(LDRPATH_LOCAL)
wineserver-installed: $(OBJS)
$(CC) -o $@ $(OBJS) $(LIBWINE) $(LIBPORT) $(LDFLAGS) $(LIBS) $(LDRPATH_INSTALL)
$(CC) -o $@ $(OBJS) $(LIBWINE) $(LIBPORT) $(LDFLAGS) $(EXTRALIBS) $(LIBS) $(LDRPATH_INSTALL)
install install-lib:: wineserver-installed $(DESTDIR)$(bindir) install-man-pages
$(INSTALL_PROGRAM) wineserver-installed $(DESTDIR)$(bindir)/wineserver
......
......@@ -51,6 +51,9 @@
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#ifdef __APPLE__
# include <mach/mach_time.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
......@@ -486,6 +489,20 @@ int send_client_fd( struct process *process, int fd, obj_handle_t handle )
/* get current tick count to return to client */
unsigned int get_tick_count(void)
{
#ifdef HAVE_CLOCK_GETTIME
struct timespec ts;
#ifdef CLOCK_MONOTONIC_RAW
if (!clock_gettime( CLOCK_MONOTONIC_RAW, &ts ))
return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
#endif
if (!clock_gettime( CLOCK_MONOTONIC, &ts ))
return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
#elif defined(__APPLE__)
static mach_timebase_info_data_t timebase;
if (!timebase.denom) mach_timebase_info( &timebase );
return mach_absolute_time() * timebase.numer / timebase.denom / 1000000;
#endif
return (current_time - server_start_time) / 10000;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment