io: add helper module for creating watches on FDs

A number of the channel implementations will require the
ability to create watches on file descriptors / sockets.
To avoid duplicating this code in each channel, provide a
helper API for dealing with file descriptor watches.

There are two watch implementations provided. The first
is useful for bi-directional file descriptors such as
sockets, regular files, character devices, etc. The
second works with a pair of unidirectional file descriptors
such as pipes.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2015-03-03 12:59:16 +00:00
parent 666a3af9c8
commit 1c809fa01d
3 changed files with 271 additions and 0 deletions

View file

@ -1 +1,2 @@
io-obj-y = channel.o
io-obj-y += channel-watch.o