[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#225300: libc6-dev: sys/poll.h do not define POLLRDNORM



On Sun, Dec 28, 2003 at 04:15:16PM +0100, Simone Piccardi wrote:
> Package: libc6-dev
> Version: 2.3.2.ds1-10
> Severity: normal
> 
> I'm writing an example program using poll. But after including sys/poll.h I
> still have a 'POLLRDNORM' undeclared error. To have it defined I must define
> __USE_XOPEN, but no mention of this in the man page. 

The poll(2) man page on my system, from manpages-dev 1.62-1, reads as
follows (in part):

                                                                   The
       following  possible  bits  in  these  masks  are   defined   in
       <sys/poll.h>
           #define POLLIN      0x0001    /* There is data to read */
           #define POLLPRI     0x0002    /* There is urgent data to read */
           #define POLLOUT     0x0004    /* Writing now will not block */
           #define POLLERR     0x0008    /* Error condition */
           #define POLLHUP     0x0010    /* Hung up */
           #define POLLNVAL    0x0020    /* Invalid request: fd not open */
       When compiling XPG4.2 source one also has
       #ifdef _XOPEN_SOURCE
           #define POLLRDNORM  0x0040    /* Normal data may be read */
           #define POLLRDBAND  0x0080    /* Priority data may be read */
           #define POLLWRNORM  0x0100    /* Writing now will not block */
           #define POLLWRBAND  0x0200    /* Priority data may be written */
       #endif
       Finally, Linux knows about
       #ifdef _GNU_SOURCE
           #define POLLMSG     0x0400
       #endif

This definitely implies to me that you need to define _XOPEN_SOURCE
(__USE_XOPEN may have the same effect but it's supposed to be set by
<features.h>, not the user) in order to get this constant. See 'info
libc "Feature Test Macros"' for information on this kind of thing.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: