Re: [patch] ppp-2.2f/2.3.x, glibc 2, and Linux 2.x

Richard Henderson (rth@cygnus.com)
Tue, 29 Jul 1997 17:02:28 -0700 (PDT)


Trevor Johnson wrote:
> - with glibc 2, <termbits.h> needs to be included in pppd/sys-linux.c.

Yikes! No. Never touch a bits file directly. For glibc 2.1 we've
made this a bit more explicit by moving them into /usr/include/bits/
and issuing #errors if we aren't being included from the right place.

That particular file gets pulled in by <termios.h>, btw.

> - there was a ^L in that same file which seemed to be causing problems.

For gcc? Not likely, the gcc sources themselves are full of ^Ls.

> - from that same file, <socketbits.h> was getting included along with
> <linux/socket.h> and <linux/if.h>, causing many things (constants
> for address and protocol families, and structs) to be redefined.
> I changed the kernel headers so those are only defined if _SOCKETBITS_H
> (defined, unsurprisingly, in <socketbits.h>) had not been defined.

Not exactly sure when they were added, but for glibc 2.0.4 at least,
try including <net/if.h> etc, just like the rest of the non-linux
world does.

In general, programs should avoid <asm/*.h> and <linux/*.h> like the
plauge. I will guarantee there will be problems if you mix libc and
kernel header files at random -- libc's types may be (are!) different
from those of the kernel and do some frobbing behind your back.

r~