[alsa-devel] ALSA 1.1.8 Release - POLLRDNORM undefined
Jay Foster
jay at systech.com
Wed Jan 9 21:39:30 CET 2019
On 1/9/2019 12:35 PM, Takashi Iwai wrote:
> On Wed, 09 Jan 2019 21:33:11 +0100,
> Takashi Iwai wrote:
>> On Wed, 09 Jan 2019 17:22:36 +0100,
>> Jay Foster wrote:
>>>
>>>
>>> On 1/9/2019 3:10 AM, Takashi Iwai wrote:
>>>> On Tue, 08 Jan 2019 18:00:18 +0100,
>>>> Jay Foster wrote:
>>>>> I am attempting to build the 1.1.8 release of alsa-utils and getting
>>>>> an error about POLLRDNORM (and others) undefined. This error comes
>>>>> from axfer/waiter-select.c. axfer/waiter-select.c includes
>>>>> "waiter.h", which includes "poll.h". This build is for a linux
>>>>> target.
>>>>>
>>>>> poll.h includes sys/poll.h which includes bits/poll.h, which only
>>>>> defines POLLRDNORM (and others) when __USE_XOPEN is defined (which it
>>>>> is not).
>>>>>
>>>>> However, linux/poll.h includes asm/poll.h which includes
>>>>> asm-generic/poll.h which does define POLLRDNORM (and others).
>>>>>
>>>>> Should I change my build to define__USE_XOPEN or should I patch
>>>>> waiter.h to include linux/poll.h instead of just poll.h?
>>>> Which libc are you using? The POSIX man page (man poll.h) mentions
>>>> POLLRDNORM defined there, at least, on my system with glibc 2.27.
>>>>
>>>>
>>>> thanks,
>>>>
>>>> Takashi
>>>>
>>>>
>>> This is a legacy ARM product using glibc 2.9. Neither of the
>>> approaches I mentioned above actually worked. <linux/poll.h> is the
>>> kernel headers, which results in a duplicate definition of struct
>>> pollfds. The other approach (I added 'CFLAGS=-D_XOPEN_SOURCE=500' to
>>> the make command line, and other variations) failed elsewhere due to
>>> missing or mismatched function prototypes (ref <features.h>).
>>>
>>> I got this to work by patching axfer/waiter.h to add the missing
>>> defintions, based on those found in <asm-generic/poll.h>.
>> I wonder what is supposed on such a system. poll() needs these POLL*
>> constant definitions, and they aren't available by simple poll.h?
>> That's weird. What does "man poll.h" say in your version?
> ... or maybe it's only about a few of them that are missing?
>
>
> Takashi
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
I think our emails crossed. Yes, only a few are missing. in
<bits/poll.h> I see:
#ifdef __USE_XOPEN
/* These values are defined in XPG4.2. */
# define POLLRDNORM 0x040 /* Normal data may be read. */
# define POLLRDBAND 0x080 /* Priority data may be read. */
# define POLLWRNORM 0x100 /* Writing now will not block. */
# define POLLWRBAND 0x200 /* Priority data may be written. */
#endif
It is only those that are not defined. Adding -D_GNU_SOURCE gets them
defined, though. Interesting how the man page for poll.h does not
mention this for glibc.
Jay
More information about the Alsa-devel
mailing list