[uClibc] defining sysinfo struct in sys/sysinfo.h

Erik Andersen andersen at codepoet.org
Mon Jul 11 19:23:48 UTC 2005


On Sun Jul 10, 2005 at 12:13:21PM -0400, Mike Frysinger wrote:
> we currently define the sysinfo struct in the sys/sysinfo.h header file ... 
> the comment there indicates binary compat issues with linux-2.4 ...
> 
> glibc simply includes the linux/sysinfo.h header file to get the struct ... is 
> this something we really need worry about anymore ?  i mean, if it works for 
> >=linux-2.4, is it something we need worry about ?  is <=linux-2.2 still a 
> supported target ?
> 
> the issue we noticed is that some apps do:
> #include <sys/sysinfo.h>
> #include <linux/sysinfo.h>

User space apps should never include linux/sysinfo.h or
for that matter any other linux kernel header file.  Apps
that do such things are broken.

uClibc is doing the right thing and glibc does it wrong
imho.  However, with glibc having just a few more users
it is generally necessary to accomodate it as well.  So
in busybox/include/libbb.h for example, I define my own
copy of struct sysinfo to avoid problems with glibc
compatibility.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list