[PATCH xserver 17/23] os: Add ospoll interface

Keith Packard keithp at keithp.com
Sat May 28 01:53:40 UTC 2016

Emil Velikov <emil.l.velikov at gmail.com> writes:

> Hi Keith,
> Style question: do you/how many others refer having separate functions for
> of ifdeffed code each vs a single with all the ifdeffs. Or in other words
> having func_foo_poll and func_foo_epoll as opposed to having it all in
> func_foo.

I started having separate versions of each function (with the same
name), but that seemed bad, so I merged the contents of the separate
functions into the single functions you see now. I found it easier to
compare the semantics of the different implementations when they were
right next to each other.

> +#ifndef _OSPOLL_H_
>> +#define _OSPOLL_H_
>> +
>> +#include <poll.h>
>> +
> This include should be in the C file with proper ifdef guard, right?

I'm not sure I understand -- we need <poll.h> on every system as ospoll
uses the POLLIN/POLLOUT defines for its arguments. We could use X server
specific values, but I think the posix ones are common across all of our
supported systems.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160527/c51b52c0/attachment.sig>

More information about the xorg-devel mailing list