diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2009-01-21 16:26:54 -0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2009-02-01 11:41:41 +1100 |
commit | 812761a1f8ff94e4913529840b905360ff843fc4 (patch) | |
tree | 5ce899b8ef5e177ce075711ce2a911bf2237a768 /lib/waiter/waiter.h | |
parent | 61679084243c471053b0b1b9865b40d721586958 (diff) | |
download | petitboot-812761a1f8ff94e4913529840b905360ff843fc4.zip petitboot-812761a1f8ff94e4913529840b905360ff843fc4.tar.gz |
Move waiter to library
Move the waiter routines into the petitboot library. The waiter
routines are generic enough to be used for both server and
client. Does not change the waiter source.
jk: move to lib/waiter/ instead of lib/
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib/waiter/waiter.h')
-rw-r--r-- | lib/waiter/waiter.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/waiter/waiter.h b/lib/waiter/waiter.h new file mode 100644 index 0000000..ff8a5ff --- /dev/null +++ b/lib/waiter/waiter.h @@ -0,0 +1,23 @@ +#ifndef _WAITER_H +#define _WAITER_H + +#include <poll.h> + +struct waiter; + +enum events { + WAIT_IN = POLLIN, + WAIT_OUT = POLLOUT, +}; + +typedef int (*waiter_cb)(void *); + +struct waiter *waiter_register(int fd, int events, + waiter_cb callback, void *arg); + +void waiter_remove(struct waiter *waiter); + +int waiter_poll(void); +#endif /* _WAITER_H */ + + |