summaryrefslogtreecommitdiff
path: root/src/common/compat.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-01-12 06:42:32 +0000
committerNick Mathewson <nickm@torproject.org>2005-01-12 06:42:32 +0000
commit324b192f68bfe697009831a5bad3acdd7bd2cec5 (patch)
tree13f8d3bd453244fcad1f519667bb4483156113bf /src/common/compat.h
parent9b578f2fe2665a1b1a75f6fb5a85f8a77ee31545 (diff)
downloadtor-324b192f68bfe697009831a5bad3acdd7bd2cec5.tar.gz
tor-324b192f68bfe697009831a5bad3acdd7bd2cec5.zip
Make Tor use Niels Provos's libevent instead of it's current
poll-but-sometimes-select mess. This will let us use faster async cores (like epoll, kpoll, and /dev/poll), and hopefully work better on Windows too. There are some fairly nasty changes to main.c here; this will almost certainly break something. But hey, that's what alphas are for. svn:r3341
Diffstat (limited to 'src/common/compat.h')
-rw-r--r--src/common/compat.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index d9cb5669d6..186416d882 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -115,6 +115,10 @@ int replace_file(const char *from, const char *to);
#define tor_close_socket(s) close(s)
#endif
+/* Now that we use libevent, all real sockets are safe for polling ... or
+ * if they aren't, libevent will help us. */
+#define SOCKET_IS_POLLABLE(fd) ((fd)>=0)
+
struct in_addr;
int tor_inet_aton(const char *cp, struct in_addr *addr);
int tor_lookup_hostname(const char *name, uint32_t *addr);