diff --git a/lib/roken/gettimeofday.c b/lib/roken/gettimeofday.c new file mode 100644 index 000000000..f394c50cf --- /dev/null +++ b/lib/roken/gettimeofday.c @@ -0,0 +1,20 @@ +#ifdef HAVE_CONFIG_H +#include +RCSID("$Id$"); +#endif + +#ifndef HAVE_GETTIMEOFDAY +/* + * Simple gettimeofday that only returns seconds. + */ +int +gettimeofday (struct timeval *tp, void *ignore) +{ + time_t t; + + t = time(NULL); + tp->tv_sec = t; + tp->tv_usec = 0; + return 0; +} +#endif diff --git a/lib/roken/swab.c b/lib/roken/swab.c new file mode 100644 index 000000000..34aeeeeb7 --- /dev/null +++ b/lib/roken/swab.c @@ -0,0 +1,18 @@ +#ifdef HAVE_CONFIG_H +#include +RCSID("$Id$"); +#endif + +#ifndef HAVE_SWAB +void +swab (char *from, char *to, int nbytes) +{ + while(nbytes >= 2) { + *(to + 1) = *from; + *to = *(from + 1); + to += 2; + from += 2; + nbytes -= 2; + } +} +#endif