Whamcloud - gitweb
510525e24a6ac307149d05a52eee32965d566f98
[fs/lustre-release.git] / lnet / ulnds / socklnd / dispatch.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (c) 2002 Cray Inc.
5  *  Copyright (c) 2002 Eric Hoffman
6  *
7  *   This file is part of Portals, http://www.sf.net/projects/sandiaportals/
8  */
9
10 /* this file is only called dispatch.h to prevent it
11    from colliding with /usr/include/sys/select.h */
12
13 typedef struct io_handler *io_handler;
14
15 struct io_handler{
16   io_handler *last;
17   io_handler next;
18   int fd;
19   int type;
20   int (*function)(void *);
21   void *argument;
22   int disabled;
23 };
24
25
26 #define READ_HANDLER 1
27 #define WRITE_HANDLER 2
28 #define EXCEPTION_HANDLER 4
29 #define ALL_HANDLER (READ_HANDLER | WRITE_HANDLER | EXCEPTION_HANDLER)
30
31 io_handler register_io_handler(int fd,
32                                int type,
33                                int (*function)(void *),
34                                void *arg);
35
36 void remove_io_handler (io_handler i);
37 void init_unix_timer(void);
38 void select_timer_block(when until);
39 when now(void);
40
41 /*
42  * hacking for CFS internal MPI testing
43  */ 
44 #undef ENABLE_SELECT_DISPATCH