Skip to contentSkip to conversation

SIOC* clash

Xenomai-core Jan Kiszka 2 participants 2 messages Feb 27, 2007

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi Wolfgang,

just realised that there is an ABI mine laid in rtcan.h:

#ifndef SIOCGIFINDEX

#define SIOCGIFINDEX \
            _IOWR(RTIOC_TYPE_CAN, 0x00, struct ifreq)

#endif

So, if you happen to have included sys/ioctl.h earlier in your application, an incompatible IOCTL code will be used in user space.

I recommend to switch to existing IOCTL codes where available (that's what we do in RTnet as well). This may also mean betting on the current IOCTL assignments in Socket-CAN, that they will survive unchanged the eventual merge into Linux mainline.

Jan

#1 lore raw
Quoted 9 lines · Jan Kiszka

Hi Wolfgang,

just realised that there is an ABI mine laid in rtcan.h:

#ifndef SIOCGIFINDEX

#define SIOCGIFINDEX \
            _IOWR(RTIOC_TYPE_CAN, 0x00, struct ifreq)

#endif

Quoted 7 lines

So, if you happen to have included sys/ioctl.h earlier in your application, an incompatible IOCTL code will be used in user space.

I recommend to switch to existing IOCTL codes where available (that's what we do in RTnet as well). This may also mean betting on the current IOCTL assignments in Socket-CAN, that they will survive unchanged the eventual merge into Linux mainline.

D'accord, I will change this with the next update.

Wolfgang.