[Xcb] Foreign file descriptors

Jamey Sharp jamey at minilop.net
Wed Sep 27 08:10:12 PDT 2006

On Wed, Sep 27, 2006 at 02:39:01PM +1000, Russell Shaw wrote:
> Hi,

Hi Russell!

> To monitor external file descriptors for things like receiving
> characters on a serial port, xlib doesn't seem to have any facility
> for that, so your application remains stuck in XNextEvent().
> Does xcb have a way around this?

No, that's outside XCB's scope. But with both Xlib and XCB, you can get
the file descriptor of the X connection and use select(2) or poll(2).
This is somewhat non-trivial to get right, though. I've been meaning to
work out what the application has to do to get this right, but haven't
gotten around to it yet.

Of course, what we actually recommend is using threads. That may be a
bad idea with Xlib, but XCB is designed to support threads

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060927/91091c2a/attachment.pgp

More information about the Xcb mailing list