/[dynamips]/upstream/dynamips-0.2.6-RC2/utils.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/dynamips-0.2.6-RC2/utils.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.6-RC1/utils.h revision 2 by dpavlin, Sat Oct 6 16:03:58 2007 UTC upstream/dynamips-0.2.6-RC2/utils.h revision 3 by dpavlin, Sat Oct 6 16:05:34 2007 UTC
# Line 223  static inline m_tmcnt_t m_gettime_usec(v Line 223  static inline m_tmcnt_t m_gettime_usec(v
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    
# Line 256  ssize_t m_read_file(char *filename,char Line 284  ssize_t m_read_file(char *filename,char
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

Legend:
Removed from v.2  
changed lines
  Added in v.3

  ViewVC Help
Powered by ViewVC 1.1.26