Put network includes in sockets.h
[mono.git] / mono / io-layer / misc.c
1 /*
2  * misc.c:  Miscellaneous internal support functions
3  *
4  * Author:
5  *      Dick Porter (dick@ximian.com)
6  *
7  * (C) 2002 Ximian, Inc.
8  */
9
10 #include <config.h>
11 #include <glib.h>
12 #include <sys/time.h>
13 #include <stdlib.h>
14
15 #include "misc-private.h"
16
17 void _wapi_calc_timeout(struct timespec *timeout, guint32 ms)
18 {
19         struct timeval now;
20         div_t divvy;
21                 
22         divvy=div((int)ms, 1000);
23         gettimeofday(&now, NULL);
24                 
25         timeout->tv_sec=now.tv_sec+divvy.quot;
26         timeout->tv_nsec=(now.tv_usec+divvy.rem)*1000;
27 }