File: mio.c

package info (click to toggle)
jabberd2 2.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 4,016 kB
  • sloc: ansic: 37,099; sh: 1,108; perl: 656; xml: 561; makefile: 511; python: 238; ruby: 145; sql: 55
file content (68 lines) | stat: -rw-r--r-- 1,650 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 * jabberd - Jabber Open Source Server
 * Copyright (c) 2002 Jeremie Miller, Thomas Muldowney,
 *                    Ryan Eatmon, Robert Norris, Christof Meerwald
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
 */

/*
   MIO -- Managed Input/Output
   ---------------------------
*/

#ifdef HAVE_CONFIG_H
#   include <config.h>
#endif

#include "mio.h"

mio_t mio_kqueue_new(int maxfd);
mio_t mio_epoll_new(int maxfd);
mio_t mio_poll_new(int maxfd);
mio_t mio_select_new(int maxfd);
mio_t mio_wsasync_new(int maxfd);

mio_t mio_new(int maxfd)
{
  mio_t m = NULL;

#ifdef MIO_KQUEUE
  m = mio_kqueue_new(maxfd);
  if (m != NULL) return m;
#endif

#ifdef MIO_EPOLL
  m = mio_epoll_new(maxfd);
  if (m != NULL) return m;
#endif

#ifdef MIO_WSASYNC
  m = mio_wsasync_new(maxfd);
  if (m != NULL) return m;
#endif

#ifdef MIO_SELECT
  m = mio_select_new(maxfd);
  if (m != NULL) return m;
#endif

#ifdef MIO_POLL
  m = mio_poll_new(maxfd);
  if (m != NULL) return m;
#endif

  return m;
}