223 |
return(((m_tmcnt_t)tvp.tv_sec * 1000000) + (m_tmcnt_t)tvp.tv_usec); |
return(((m_tmcnt_t)tvp.tv_sec * 1000000) + (m_tmcnt_t)tvp.tv_usec); |
224 |
} |
} |
225 |
|
|
226 |
|
#ifdef __CYGWIN__ |
227 |
|
#define GET_TIMEZONE _timezone |
228 |
|
#else |
229 |
|
#define GET_TIMEZONE timezone |
230 |
|
#endif |
231 |
|
|
232 |
|
/* Get current time in number of ms (localtime) */ |
233 |
|
static inline m_tmcnt_t m_gettime_adj(void) |
234 |
|
{ |
235 |
|
struct timeval tvp; |
236 |
|
struct tm tmx; |
237 |
|
time_t gmt_adjust; |
238 |
|
time_t ct; |
239 |
|
|
240 |
|
gettimeofday(&tvp,NULL); |
241 |
|
ct = tvp.tv_sec; |
242 |
|
localtime_r(&ct,&tmx); |
243 |
|
|
244 |
|
#if defined(__CYGWIN__) || defined(SUNOS) |
245 |
|
gmt_adjust = -(tmx.tm_isdst ? GET_TIMEZONE - 3600 : GET_TIMEZONE); |
246 |
|
#else |
247 |
|
gmt_adjust = tmx.tm_gmtoff; |
248 |
|
#endif |
249 |
|
|
250 |
|
tvp.tv_sec += gmt_adjust; |
251 |
|
return(((m_tmcnt_t)tvp.tv_sec * 1000) + ((m_tmcnt_t)tvp.tv_usec / 1000)); |
252 |
|
} |
253 |
|
|
254 |
/* Add an element to a list */ |
/* Add an element to a list */ |
255 |
m_list_t *m_list_add(m_list_t **head,void *data); |
m_list_t *m_list_add(m_list_t **head,void *data); |
256 |
|
|
284 |
/* Allocate aligned memory */ |
/* Allocate aligned memory */ |
285 |
void *m_memalign(size_t boundary,size_t size); |
void *m_memalign(size_t boundary,size_t size); |
286 |
|
|
287 |
|
/* Block specified signal for calling thread */ |
288 |
|
int m_signal_block(int sig); |
289 |
|
|
290 |
|
/* Unblock specified signal for calling thread */ |
291 |
|
int m_signal_unblock(int sig); |
292 |
|
|
293 |
|
/* Set non-blocking mode on a file descriptor */ |
294 |
|
int m_fd_set_non_block(int fd); |
295 |
|
|
296 |
#endif |
#endif |