~ubuntu-branches/ubuntu/hoary/tor/hoary

« back to all changes in this revision

Viewing changes to src/common/fakepoll.h

  • Committer: Bazaar Package Importer
  • Author(s): Peter Palfrader
  • Date: 2004-06-07 21:46:08 UTC
  • Revision ID: james.westby@ubuntu.com-20040607214608-do51p01di99xdmjr
Tags: upstream-0.0.7
ImportĀ upstreamĀ versionĀ 0.0.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2002,2003 Nick Mathewson, Roger Dingledine. */
 
2
/* See LICENSE for licensing information */
 
3
/* $Id: fakepoll.h,v 1.10 2004/05/10 07:54:13 arma Exp $ */
 
4
 
 
5
#ifndef __FAKEPOLL_H
 
6
#define __FAKEPOLL_H
 
7
 
 
8
/**
 
9
 * \file fakepoll.h
 
10
 * \brief Headers for fakepoll.c
 
11
 */
 
12
 
 
13
#include "orconfig.h"
 
14
 
 
15
#define POLL_NO_WARN
 
16
 
 
17
#if defined(HAVE_POLL_H)
 
18
#include <poll.h>
 
19
#elif defined(HAVE_SYS_POLL_H)
 
20
#include <sys/poll.h>
 
21
#endif
 
22
 
 
23
/* If _POLL_EMUL_H_ is defined, then poll is just a just a thin wrapper around
 
24
 * select.  On Mac OS 10.3, this wrapper is kinda flaky, and we should
 
25
 * use our own.
 
26
 */
 
27
#if !(defined(HAVE_POLL_H)||defined(HAVE_SYS_POLL_H))&&!defined(_POLL_EMUL_H_)
 
28
#define USE_FAKE_POLL
 
29
#endif
 
30
 
 
31
#if defined USE_FAKE_POLL && !defined(_POLL_EMUL_H_)
 
32
struct pollfd {
 
33
  int fd;
 
34
  short events;
 
35
  short revents;
 
36
};
 
37
 
 
38
#define POLLIN   0x0001
 
39
#define POLLPRI  0x0002
 
40
#define POLLOUT  0x0004
 
41
#define POLLERR  0x0008
 
42
#define POLLHUP  0x0010
 
43
#define POLLNVAL 0x0020
 
44
#endif
 
45
 
 
46
int tor_poll(struct pollfd *ufds, unsigned int nfds, int timeout);
 
47
 
 
48
#endif
 
49
 
 
50
/*
 
51
  Local Variables:
 
52
  mode:c
 
53
  indent-tabs-mode:nil
 
54
  c-basic-offset:2
 
55
  End:
 
56
*/