Skip to contentSkip to conversation

examples/netmap_compat: Fix compile issue with POLLRDNORM

PATCH Applied Michael Qiu 2 participants 2 messages Dec 11, 2015 – Dec 12, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/netmap_compat: Fix compile issue with POLLRDNORM

examples/netmap_compat/bridge/../lib/compat_netmap.c:880:41:
error: ‘POLLRDNORM’ undeclared (first use in this function)

The root casue is POLLRDNORM is more-or-less nonstandard, and it depends on macro "__USE_XOPEN".

Fixes 06371afe394d (examples/netmap_compat: import netmap compatibility example)

In suse11 sp3, POLLRDNORM will not be defined because "__USE_XOPEN" issue.

This patch add check if it is not defined, define it.

---
 examples/netmap_compat/lib/compat_netmap.c | 8 ++++++++
 1 file changed, 8 insertions(+)
examples/netmap_compat/lib/compat_netmap.c +8 -0
index d2e079f..dd6d4f9 100644
@@ -73,6 +73,14 @@ struct fd_port {
 	uint32_t port;
 };
 
+#ifndef POLLRDNORM
+#define POLLRDNORM	0x0040
+#endif
+
+#ifndef POLLWRNORM
+#define POLLWRNORM	0x0100
+#endif
+
 #define	FD_PORT_FREE	UINT32_MAX
 #define	FD_PORT_RSRV	(FD_PORT_FREE - 1)
 
Signature · 1 line
1.9.3
#1 lore raw

2015-12-11 14:36, Michael Qiu:

Quoted 6 lines

examples/netmap_compat/bridge/../lib/compat_netmap.c:880:41:
error: ‘POLLRDNORM’ undeclared (first use in this function)

The root casue is POLLRDNORM is more-or-less nonstandard, and it depends on macro "__USE_XOPEN".

Quoted 8 lines
Fixes 06371afe394d (examples/netmap_compat: import netmap compatibility example)

In suse11 sp3, POLLRDNORM will not be defined because "__USE_XOPEN" issue.

This patch add check if it is not defined, define it.

Applied, thanks