A problem with header file sonet.h

Charles Trois yellowdog-general@lists.terrasoftsolutions.com
Wed Aug 27 03:48:01 2003


le 25/08/03 20:01, yellowdog-general-request@lists.terrasoftsolutions.com =E0
yellowdog-general-request@lists.terrasoftsolutions.com a =E9crit=A0:

> Message: 5
> Date: Mon, 25 Aug 2003 11:07:23 -0400
> From: Bill Fink <billfink@mindspring.com>
> To: YellowDog Linux General <yellowdog-general@lists.terrasoftsolutions.c=
om>
> Cc: Bill Fink <billfink@mindspring.com>
> Subject: Re: A problem with header file sonet.h
> Reply-To: yellowdog-general@lists.terrasoftsolutions.com
>=20
> Hi Charles,
>=20
> On Sun Aug 24 2003, Charles Trois wrote:
>=20
>>=20
>>> From that, it appears that there is something wrong in my copy of sonet=
.h
>> (which comes from YDL 3.0).
>>=20
>> Hence my two questions:
>>=20
>> 1.  How can I get hold of a clean copy of this sonet.h file?
>>=20
>> 2.  Alternatively, I could try to put things right by editing the file.
>> Although I have some knowledge of C, I cannot spot the error(s). Below i=
s
>> the copy of my sonet.h, in case someone more experienced than me can see=
 the
>> solution.
>=20
> I don't know anything about the speedbundle package, but the include
> file /usr/include/linux/sonet.h does appear to be really messed up.
> If you compare it with the kernel version
> /usr/src/linux/include/linux/sonet.h,
> you will see the following in the kernel version:
>=20
> #ifndef __KERNEL__
> #undef __SONET_ITEMS
> #else
>=20
> #include <asm/atomic.h>
>=20
> struct k_sonet_stats {
> #define __HANDLE_ITEM(i) atomic_t i
> __SONET_ITEMS
> #undef __HANDLE_ITEM
> };
>=20
> extern void sonet_copy_stats(struct k_sonet_stats *from,struct sonet_stat=
s
> *to);
> extern void sonet_subtract_stats(struct k_sonet_stats *from,
> struct sonet_stats *to);
>=20
> #endif
>=20
> So everything in the #else section shouldn't appear in the
> /usr/include/linux/sonet.h version of the include file, but in
> fact it does.  This even causes there to be two #endif statements
> to only one #if statement (and I see you have commented one of
> them out.  So you should be able to delete everything from the
> #else section that appears incorrectly in the /usr/include/linux/sonet.h
> include file (keep a backup copy first), and see if that helps.

Hello Bill,=20

Your erudition amazes me.

Taking advantage of your explanations, I simply replaced the sonet.h file i=
n
/usr/include/linux/ by a copy of the one in/usr/src/linux/include/linux/.

This solved the problem and I was able to install the speedbundle package
without trouble (I still have to make it mork, but this might be another
story).

Many thanks.

Charles