Date: Fri, 14 Feb 2003 17:29:57 -0800 (PST)
Subject: Re: POSIX Shared Memory with Linux
From: "nate" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]

Thanks, Nate!

>Jiahan Chen said:
>> Hi,
>>
>> shared memory functionality. When I tried to
>> port some POSIX code to Linux, and got compililing
>> error: can't find mmap.h which is necessary header
>> file for POSIX shared memory stuff, such as
>> shm_open(), shm_unlink(), mmap()......

>be sure you have the /dev/shm filesystem mounted for POSIX
>shared memory under linux 2.4(by default it's mounted on rh 7.3).

>I don't see mmap.h on either of my redhat nor any of my
>debian systems.

The header file should be mman.h.
However, link still complained about shm_open() and shm_unlink():
  undefined reference to `shm_open'
  undefined reference to `shm_unlink'
  I did try  default and adding libmm.a and libglib.a:
   gcc  -o program program.c
   gcc  -o program -lmm -lglib program

  I don't know what lib shall be linked to it, or
  the current redhat 7.3 has no lib for shm_func() of POSIX?


>from Documentation/filesystems/tmpfs.txt:
>tmpfs has the following uses:

>2) glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
>  POSIX shared memory (shm_open, shm_unlink). Adding the following
>  line to /etc/fstab should take care of this:

>       tmpfs   /dev/shm        tmpfs   defaults        0 0

I added this item to /etc/fstab, it seems fine after reboot.

>  Remember to create the directory that you intend to mount tmpfs on
>   if necessary (/dev/shm is automagically created if you use devfs).

>  This mount is _not_ needed for SYSV shared memory. The internal
>   mount is used for that. (In the 2.3 kernel versions it was
>  shared memory)

Since commands are very useful to debug program containing shared memory,
however, it looks like there are only System V commands available in
redhat 7.3: /usr/bin/ipcs, ipcrm
The corresponding POSIX commands shall be lipcs, lrmipc (lipcrm?).
I wish these commands to be added for Linux, or where can be found
on-line for download?

In addition, there are no man pages for shm_func on Linux.

Jiahan

>nate




__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to