Emil Velikov <[email protected]> writes:

> There's two things which I should have mentioned:
>  - How does one have poll.h when poll() is missing - Cygwin may have
> the header, although I'm not sure about other Windows based
> implementations (the mingw and msvc ones).

I'd expect whatever changes were needed to support those operating
systems to come from people using them. In particular, Windows has
winsock2.h, which may provide the necessary values, but as I'm not doing
that port, I can't really say what changes should be provided. I'd love
to get feedback from people who can provide it.

>  - Considering that we have our own header with wrapper functions and
> an opaque struct, it would make sense to have X server specific
> macros. Even (ideally) if they are ABI compatible with the POSIX ones.

Yeah, maybe just using X_NOTIFY_READ, X_NOTIFY_WRITE instead of
POLLIN/POLLOUT:

How about:

#define X_NOTIFY_READ   POLLIN
#define X_NOTIFY_WRITE  POLLOUT
#define X_NOTIFY_OTHER  (!(POLLIN|POLLOUT))

so you would do

        if (revents & X_NOTIFY_READ)
                read ready
        if (revents & X_NOTIFY_WRITE)
                write ready
        if (revents & X_NOTIFY_OTHER)
                deal with errors

Does this seem reasonable? It does change the ABI to tacitly depend on
the values in poll.h, but those aren't going to change.

-- 
-keith

Attachment: signature.asc
Description: PGP signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to