Hello, to compile kexec-tools statically against klibc we still need a patch for socket.h, otherwise: | kexec/ifdown.c:46:16: error: 'SIOCGIFCONF' undeclared (first use in this function) | kexec/ifdown.c:46:16: note: each undeclared identifier is reported only once for each function it appears in | kexec/ifdown.c:65:18: error: 'SIOCSIFFLAGS' undeclared (first use in this function) In fact: lib/klibc $ grep -R SIOCGIFCONF . ./include/linux/if.h: * Structure used in SIOCGIFCONF request. ./include/linux/sockios.h:#define SIOCGIFCONF 0x8912 /* get iface list lib/klibc $ grep -R SIOCSIFFLAGS . ./include/linux/sockios.h:#define SIOCSIFFLAGS 0x8914 /* set flags */ Now, the patch we are using in OpenEmbedded is +#include <linux/socket.h> + +#include <linux/version.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include <linux/sockios.h> /* the SIOCxxx I/O controls */ +#endif + +#include <linux/uio.h> but it looks like you could as well add the SIOCGIFCONF and SIOCSIFFLAGS. Regards Andrea
Hello (2011/08/08 21:22), Andrea Adami wrote:> Hello, > > to compile kexec-tools statically against klibc we still need a patch > for socket.h, otherwise: > > | kexec/ifdown.c:46:16: error: 'SIOCGIFCONF' undeclared (first use in > this function) > | kexec/ifdown.c:46:16: note: each undeclared identifier is reported > only once for each function it appears in > | kexec/ifdown.c:65:18: error: 'SIOCSIFFLAGS' undeclared (first use in > this function)SIOCGIFCONF and SIOCSIFFLAGS are arguments for ioctl(). Including 'sys/ioctl.h' of Embedded GNU C Library define them, but including 'sys/socket.h' of it do not define them. Of course, 'kexec-tools/kexec/ifdown.c' includes <sys/ioctl.h> also. This is why 'sys/ioctl.h' of klibc may have to be changed if klibc wants more compatibility with (Embedded) GNU C Library. For example, as you wrote, it may have to include 'linux/sockios.h'. Test: $ cat foo.c #include <sys/socket.h> #ifdef SIOCGIFCONF # error "SIOCGIFCONF is defined." #else # error "SIOCGIFCONF is NOT defined." #endif #include <sys/ioctl.h> #ifdef SIOCGIFCONF # error "SIOCGIFCONF is defined." #else # error "SIOCGIFCONF is NOT defined." #endif $ gcc foo.c foo.c:5:3: error: #error "SIOCGIFCONF is NOT defined." foo.c:10:3: error: #error "SIOCGIFCONF is defined." thank you. -- KUMAAN 9maaan at gmail.com
Possibly Parallel Threads
- [PATCH] include: [sys/ioctl.h] needs linux/sockios.h
- [PATCH 3/3] Add relevant socket.h definitions
- Anyone using SCO 3.2v4.2 with Samba 1.9.18p3??
- ipconfig:About the length of 'options' field of DHCP packet
- issue using SRIOV "Unable to start - perhaps the PF driver is not up yet", while PF driver is actually up