On Die, 2006-03-14 at 21:49 -0600, DJ Lucas wrote:
> Jürg.  I haven't really looked into it, other than a grep through glibc 
> source, but would it be acceptable to replace these headers with 
> something like the following (example taken from llh linux/socket.h):
> 
> ----------------------------include/linux/if.h-------------------------
> #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
> #warning "You should include <net/if.h>. This time I will do it for you."
> #endif
> #include <net/if.h>
> -----------------------------------------------------------------------
> and
> [...]

Yes, that should work fine. This compatibility layer won't solve all
problems but probably quite a lot. I prefer fixing applications to use
the more portable header locations but compatibility headers can be
pretty convenient.

> 
> Or are they actually _needed_ by any known userspace apps?  Ther may 

Hard to tell, probably not, as I haven't found major parts missing in
glibc' equivalent to those kernel headers. The glibc headers are
organized a bit differently, though, some definitions are guarded by
defines from features.h which may require _..._SOURCE defines during
compilation - as has happened with rp-pppoe.

> wind up being several that can be 'fixed' that way.  BTW, LLH uses this 
> method for the following files (all linux/* warning lines wrapped in an 
> ifdef for glibc and strict ansi):
> 
> linux/acct.h - sys/acct.h
> linux/resource.h - sys/resource.h
> linux/signal.h - signal.h
> linux/socket.h - sys/socket.h
> linux/time.h - sys/time.h
> linux/un.h - sys/un.h
> linux/utime.h - utime.h
> linux/wait.h - sys/wait.h
> asm-*/io.h - sys/io.h

My script removes all these and additionally ax25.h, dirent.h, elf.h,
if.h, in.h, ip.h, netrom.h, quota.h, route.h, stat.h, and timex.h. So
that should be the list of files for the compatibility layer,
approximately.

I've just noticed that resource.h is in the wrong removal category...

Regards,

Jürg

--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to