[linux-audio-dev] Shared memory?

Juhana Sadeharju kouhia at nic.funet.fi
Thu Jul 3 10:41:01 UTC 2003


Hello. I have problems in getting a shared memory to work.
What works is my shmalloc() which is used for sharing memory
over fork(). What does not work is sharing memory between
arbitrary processes. This latter uses ftok() with a pathname
(e.g., "/tmp/globalshm") in identifying the shared memory.
Each process uses the pathname for gaining access to the shared
memory.

The simple example in "http://www.funet.fi/~kouhia/shmserver.tar.gz"
does not work. It looks like shmserver creates the shared memory,
but shmclient cannot find it.

I use now shmget() but I have also used mmap() for shared memory.
I don't remember the reason why I moved from mmap() to shmget().
Were there any limitations?

What then is the "/dev/shm" seen in the "df" listing? How that is
used?

Best regards,

Juhana



More information about the Linux-audio-dev mailing list