diff -urN trickle-1.06.ori/trickle-overload.c trickle-1.06/trickle-overload.c --- trickle-1.06.ori/trickle-overload.c Tue Jun 3 00:13:28 2003 +++ trickle-1.06/trickle-overload.c Wed Mar 3 20:26:39 2004 @@ -7,6 +7,7 @@ * $Id: trickle.patch,v 1.1.1.1 2004/03/11 20:14:09 kmbs Exp $ */ +#define _BSD_SOCKLEN_T_ /* Ick. linux sucks. */ #define _GNU_SOURCE @@ -35,7 +36,9 @@ #include #include #include -#include +#ifndef __APPLE__ +#include "poll.h" +#endif /* done below */ #include #include #if defined(HAVE_TIME_H) && defined(TIME_WITH_SYS_TIME) @@ -473,10 +476,37 @@ #define POLL_WRMASK (POLLOUT | POLLWRNORM | POLLWRBAND) #define POLL_RDMASK (POLLIN | /* POLLNORM | */ POLLPRI | POLLRDNORM | POLLRDBAND) +#if defined(__APPLE__) +/* Data structure describing a polling request, from fakepoll.h */ +struct pollfd + { + int fd; /* file desc to poll */ + short events; /* events of interest on fd */ + short revents; /* events that occurred on fd */ + }; + +//poll flags +#define POLLIN 0x0001 +#define POLLOUT 0x0004 +#define POLLERR 0x0008 + +// synonyms +#define POLLNORM POLLIN +#define POLLPRI POLLIN +#define POLLRDNORM POLLIN +#define POLLRDBAND POLLIN +#define POLLWRNORM POLLOUT +#define POLLWRBAND POLLOUT + +// ignored +#define POLLHUP 0x0010 +#define POLLNVAL 0x0020 +#endif /*__APPLE__*/ + #if defined(__linux__) || (defined(__svr4__) && defined(__sun__)) int poll(struct pollfd *fds, nfds_t nfds, int __timeout) -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || (defined(__APPLE)) int poll(struct pollfd *fds, unsigned int nfds, int __timeout) #else diff -urN trickle-1.06.ori/trickled.c trickle-1.06/trickled.c --- trickle-1.06.ori/trickled.c Fri May 9 03:16:42 2003 +++ trickle-1.06/trickled.c Wed Mar 3 20:26:39 2004 @@ -19,6 +19,7 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ +#define _BSD_SOCKLEN_T_ #include #include #include diff -urN trickle-1.06.ori/xdr.c trickle-1.06/xdr.c --- trickle-1.06.ori/xdr.c Mon Jun 2 01:07:01 2003 +++ trickle-1.06/xdr.c Wed Mar 3 20:26:39 2004 @@ -8,7 +8,9 @@ */ #include - +#ifdef __APPLE__ +#include +#endif #include "message.h" #define X(x) do { \