Re: shared libraries and memory

Riley Williams (rhw@MemAlpha.CX)
Mon, 24 May 1999 01:03:54 +0100 (GMT)


Hi Barry.

> I have a shared library of commands for wrapping kernel
> functions like open, close, read & write. When the open command
> is called I return a user defined file handle and I want to be
> able to recognise this file handle later when the read or write
> is called. How do I allocate memory in a shared library and
> refer to it later? Is there any way to keep the data/bbs
> segments of the shared library in memory and refer to them
> later?

The obvious way would be to use a local static pointer of some kind,
with it defaulting to NULL and the code allocating a block of memory
if entered when that's set NULL and pointing it to the block
allocated...

Best wishes from Riley.

+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
* ftp://ftp.MemAlpha.cx/pub/rhw/Linux
* http://www.MemAlpha.cx/kernel.versions.html

-
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/