I need to add SIGCHLD handling to child.c.  For that to work, child_open() must
be able to insert an additional pollfd into the event loop.  I am really unsure
how best to handle this.  One thought is to specify read/write/hangup/error
callbacks for each pollfd.

typedef int (*poll_cb_t)(device_t*);
struct pollfd_ex {
    device_t* dev;
    VEC_T(poll_cb_t) readable_cbs;
    VEC_T(poll_cb_t) writable_cbs;
    VEC_T(poll_cb_t) pollerr_cbs;
};

But the above has problems, since it effectively forbids the low-level or high-
level code from changing its callbacks after the device is opened.  Maybe this
is an acceptable restriction.


Adding or removing devices inside the event loop is dangerous unless certain
precautions are taken.  Document this.  Better yet, ensure safety.


int device_send(device_t* dev, char** buf, int  len)
int device_recv(device_t* dev, char** buf, int* len)

# vim: set ts=4 sts=4 sw=4 tw=80 et syn=off:
