Defining _DBUS_POLL* in dbus-sysdeps.h

Schmottlach, Glenn GSchmott at
Fri Nov 7 13:01:22 PST 2008

I'm not sure I follow you here. Looking at the top of dbus-sysdeps.h I
see the following:

/* AIX sys/poll.h does #define events reqevents, and other
 * wonderousness, so must include sys/poll before declaring
 * DBusPollFD
#ifdef HAVE_POLL
#include <sys/poll.h>

So, if HAVE_POLL is indeed defined (as determined by 'configure'), you
will indeed be pulling in a system header file. Since poll.h is already
being included, what does it hurt to use the definitions for POLL* found
there? They will certainly be more accurate than just assuming
hard-coded values. My approach only resorts to the hard-coded values if
HAVE_POLL has not been defined. Otherwise, you risk your definitions
being incorrect for a given platform (which was the case for QNX).

Perhaps you can elaborate on your concerns. . . I must be missing
something subtle.

Thanks . . .

-----Original Message-----
From: havoc.pennington at [mailto:havoc.pennington at] On
Behalf Of Havoc Pennington
Sent: Friday, November 07, 2008 3:50 PM
To: Schmottlach, Glenn
Cc: dbus at
Subject: Re: Defining _DBUS_POLL* in dbus-sysdeps.h


On Fri, Nov 7, 2008 at 11:18 AM, Schmottlach, Glenn
<GSchmott at> wrote:
> I wonder, if "HAVE_POLL" is already defined, then why not use the
> POLL* values defined in the header sys/poll.h instead of hard-coding
> The code would then look like this and be much more portable to other
> (namely QNX ;-):

The idea is to avoid system headers, so platform dependencies are
completely contained in the -sysdeps files

If system headers are included, inevitably they end up getting used or
relied on in some way.

Should just add a qnx case here probably.


More information about the dbus mailing list