POSIX headers and PTHREAD_IPROPAGATE
If I attempt to use PTHREAD_IPROPAGATE in my userspace POSIX skin Xenomai program, I get the following:
irqtest.c: In function ‘main’:
irqtest.c:278: error: ‘XN_ISR_PROPAGATE’ undeclared (first use in this function)irqtest.c:278: error: (Each undeclared identifier is reported only once irqtest.c:278: error: for each function it appears in.)
Including <nucleus/intr.h> fixes the problem. I assume there should be a #include in one of the POSIX header files.
-Jeff
Quoted 7 lines · Jeff Webb
If I attempt to use
PTHREAD_IPROPAGATEin my userspace POSIX skin Xenomai program, I get the following:
irqtest.c: In function ‘main’:
irqtest.c:278: error: ‘XN_ISR_PROPAGATE’ undeclared (first use in this function)irqtest.c:278: error: (Each undeclared identifier is reported only once irqtest.c:278: error: for each function it appears in.)Including <
nucleus/intr.h> fixes the problem. I assume there should be a #include in one of the POSIX header files.
I checked the trunk and the v2.2.x branch, and pthread.h includes nucleus/xenomai.h which includes nucleus/intr.h, so including directly nucleus/intr.h should not be necessary.
Signature · 1 line
Gilles Chanteperdrix
Quoted 10 lines · Gilles Chanteperdrix
Quoted 9 lines · Jeff Webb
If I attempt to use
PTHREAD_IPROPAGATEin my userspace POSIX skin Xenomai program, I get the following:
irqtest.c: In function ‘main’:
irqtest.c:278: error: ‘XN_ISR_PROPAGATE’ undeclared (first use in this function)irqtest.c:278: error: (Each undeclared identifier is reported only once
irqtest.c:278: error: for each function it appears in.)
Quoted 7 lines
Quoted 2 lines
Including <
nucleus/intr.h> fixes the problem. I assume there should be a #include in one of the POSIX header files.I checked the trunk and the v2.2.x branch, and
pthread.hincludesnucleus/xenomai.hwhich includesnucleus/intr.h, so including directlynucleus/intr.hshould not be necessary.
The main header is not included in the user-space case. The patch below should fix this:
posix/pthread.h +3 -2
@@ -147,10 +147,11 @@#include <sched.h> #include_next <pthread.h>#include <nucleus/thread.h> +#include <nucleus/intr.h> struct timespec ; -#endif /* !(__KERNEL__ || __XENO_SIM__) */ +#endif /* __KERNEL__ || __XENO_SIM__ */ #define PTHREAD_PRIO_NONE 0#define PTHREAD_PRIO_INHERIT 1
@@ -497,6 +498,6 @@ }#endif -#endif /* !(__KERNEL__ || __XENO_SIM__) */ +#endif /* __KERNEL__ || __XENO_SIM__ */ #endif /* _XENO_POSIX_PTHREAD_H */
Signature · 1 line
Philippe.