comparison scpmisc.h @ 435:337c45621e81

merge of 'a9b0496634cdd25647b65e585cc3240f3fa699ee' and 'c22be8b8f570b48e9662dac32c7b3e7148a42206'
author Matt Johnston <matt@ucc.asn.au>
date Thu, 22 Feb 2007 14:53:49 +0000
parents 5686ee0a3338
children 83d85b28b353
comparison
equal deleted inserted replaced
434:0aaaf68e97dc 435:337c45621e81
44 char *xstrdup(const char *); 44 char *xstrdup(const char *);
45 45
46 char *ssh_get_progname(char *); 46 char *ssh_get_progname(char *);
47 void fatal(char* fmt,...); 47 void fatal(char* fmt,...);
48 void sanitise_stdfd(void); 48 void sanitise_stdfd(void);
49
50 /* Required for non-BSD platforms, from OpenSSH's defines.h */
51 #ifndef timersub
52 #define timersub(a, b, result) \
53 do { \
54 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
55 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
56 if ((result)->tv_usec < 0) { \
57 --(result)->tv_sec; \
58 (result)->tv_usec += 1000000; \
59 } \
60 } while (0)
61 #endif
62
63 #ifndef TIMEVAL_TO_TIMESPEC
64 #define TIMEVAL_TO_TIMESPEC(tv, ts) { \
65 (ts)->tv_sec = (tv)->tv_sec; \
66 (ts)->tv_nsec = (tv)->tv_usec * 1000; \
67 }
68 #endif
69