[ELDK] Posix Shared Memory

Daniel Stonier d.stonier at gmail.com
Thu May 22 11:11:09 CEST 2008


2008/5/22 Wolfgang Denk <wd at denx.de>:
> In message <27dfa3d0805220031j5e89c99bh1524c764763fbbc5 at mail.gmail.com> you wrote:
>> Hi,
>>
>> Using an AMC440EP and just realised the posix shared memory wasn't
>> around. Had somewhat taken that for granted on my pc systems. To
>> configure the kernel I've tried
>>
>> Filesystems -> Pseudo filesystems -> Virtual memory filesystem support
>>
>> or more simply, tmpfs. Do I also need to enable
>>
>> General Setup -> Use full shmem filesystem?
>
> You have to enable CONFIG_SYSVIPC
>
>> Regardless, neither seem to be working. If I use the tmpfs and mount
>> it on /dev/shm as the man pages suggest, the tmpfs seems to work.
>> Creation of files there work ok and disappear on unmounting, but still
>> I get errors when trying to create a shared memory object. The
>> returned error value (errno) obtained after a failed shm_open is also
>> curious - 38. Which is one of the real time signals, not an expected
>> shm_open error value.
>
> Your interpretation is wrong. Errno == 38 == ENOSYS means
> (see "man errno" and /usr/include/asm-generic/errno.h):
>
> #define        ENOSYS          38       /* Function not implemented */
>
> And "Function not implemented" makes perfect sense if you did not
> cunfigure the feature in the kernel.

Oh, indeed. I missed that one - was just wading through the posix header
files looking for the definition.

>> If anyone's tried this before and has some advice, it'd be much
>> appreciated, thanks.
>
> Enable CONFIG_SYSVIPC and try again...

I was actually looking for the posix implementations rather than the SYSV.
Everything we've done so far is implemented around the posix libraries
rather than the SYSV. I'd almost decied to try them though, but finally
found the configuration which enabled the posix:

General Setup -> Support for paging of anonymous memory (swap)
General Setup -> Configure standard kernel features -> Use full shmem filesystem
Filesystems -> Pseudo filesystems -> Virtual memory filesystem support

Setting up /dev/shm in fstab and enabling the swap (with a reboot) seems to
be working.

In your experience, is there any reason to favour SYSV over Posix? We
only chose posix keeping in mind that we may wish to port to QNX in the
future.

Thanks,
Daniel Stonier.


More information about the eldk mailing list