Re: RPC in the kernel

Khimenko Victor (khim@sch57.msk.ru)
Fri, 30 Jul 1999 11:01:20 +0400 (MSD)


In <00c601bed9f7$01035e20$f9e1869f@murphy3> Barry Bevel (reganjt@cs.tcd.ie) wrote:
> Hello,

> I wrote a simple network filesystem which uses RPC in userland.
> I also wrote a VFS version as a loadable kernel module,
> which compiles fine until I include the RPC code.

> Once I include <rpc/rpc.h> together with <linux/locks.h> I get many
> errors about redefining struct, const etc... I cannot compile <rpc/rpc.h>
> and <linux/locks.h> together without this happening,
> and I need both.

You DO NOT need both. <rpc/rpc.h> is GLibC header. You can not use
GLibC functions in kernel anyway so what's the point of including <rpc/rpc.h> ?

> I have kernel 2.0.32.
> I noticed that kernel 2.2.x has many updates, including a kernel nfs server
> and updates to the RPC code. Also updates to the VFS.

Plus updates to the networking code and so on.

> Will upgrading solve this problem?

Hardly. Basic rule remains the same: GLibC and kernel headers are oil and
water. You can not mix them.

> If so, will I have to re-write the VFS/RPC code for the newer kernel.
> Is there an quicker solution than upgrading?

The only right solution is just to not use <rpc/rpc.h>... It's wrong header.
You do not need it. If functions needed to you are in kernel you should find
them in some kernel header file, if not -- you are out of luck and should
include them in your module. In any case you do not need headers from GLibC ...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/