get_header_tar.c: makedev [PATCH]
Peter S. Mazinger
ps.m at gmx.net
Thu Sep 29 07:42:05 UTC 2005
On Wed, 28 Sep 2005, Rob Landley wrote:
> On Wednesday 28 September 2005 17:14, Shaun Jackman wrote:
> > get_header_tar.c uses the macro makedev, which is not defined by any
> > standard header. In practice, it's defined either by sys/types.h,
> > sys/sysmacros.h, or sys/mkdev.h. glibc defines makedev in
> > sys/sysmacros.h which is included by sys/types.h. To support newlib,
> > include sys/sysmacros.h directly. I armoured the include in an ifdef
> > to allow for a system that defines makedev in sys/types.h but does not
> > provide sys/sysmacros.h.
>
> If sys/sysmacros.h is the correct #include then we should include it
> unconditionally. (If uClibc needs to be fixed, we can fix it.)
>
> If sys/types.h is the correct #include, then fix newlib.
>
> How do we go about determining this?
glibc-2.3.5:
defined in sys/sysmacros.h only for __GLIBC_HAVE_LONG_LONG
included by sys/types.h only for __USE_BSD
uClibc-svn:
defined in sys/sysmacros.h unconditionally
included by sys/types.h only for __USE_BSD
dietlibc-cvs:
defined in sys/stat.h unconditionally
sys/types.h does not include sys/stat.h or sys/sysmacros.h
sys/sysmacros.h includes sys/stat.h
klibc-1.1:
defined in sys/sysmacros.h unconditionally
sys/types.h includes sys/sysmacros.h unconditionally
(these 2 headers suggest, that types.h should always be included before
sysmacros.h)
newlib (combined cvs sources w/ binutils and others, also 1.13.0):
makedev not present at all
Python's pyconfig.h suggests that some could have makedev defined in
mkdev.h though (but those could have sys/types.h including sys/mkdev.h)
the header rpc/types.h (glibc, uClibc and dietlibc) does:
#ifndef makedev
#include <sys/types.h>
#endif
Well, dietlibc is not quite consequent.
Peter
--
Peter S. Mazinger <ps dot m at gmx dot net> ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08 BB6E C389 975E A5F0 59F2
More information about the busybox
mailing list