Hello,

Based on the man page of sem_init(), if pshared == 1 (2nd parameter of sem_init) -1 is returned and errno is set to ENOSYS.

The application that I am testing just checks the return value of sem_init. 0 go ahead with other tasks. -1 print a sem_init failure notice. Sorry this application is proprietary.

The issue occurs when I run the application in coLinux. The sem_init failure notice is being printed! But when I run the application on Shrike the application runs flawlessly! The weird thing is that the application sould fail for both systems since the code uses pshared == 1. I was perplexed as to why this was occuring. I traced the applications code in Shrike and coLinux. Found that on Shrike sem_init was returning ZER0. coLinux was correctly returning -1.

Earlier this morning (at least on my part of the world) I tried to create a simple test app that just calls sem_init(). Weird thing again, now both Shrike and coLinux is returning -1.


As pointed out by Henry, the kernel shipped with coLinux has SYSVIPC support. Hmmn. I'll tinker the application a bit more. I'll post whenever I can.

Thanks, Henry.

- mela.

On 10/7/05, Henry Nestler <Henry.Ne@arcor.de> wrote:

CONFIG_SYSVIPC=y is set in colinux kernel.
http://lxr.xpto.ath.cx/source/conf/linux-config?v=0.6.3#L25

Returns it an error all times?
Have you start your program with "strace" to see more about the error
condition?

Can you give a small source sample for testing?

Mela Custodining wrote:

> Hello,
>
> i did perform those checks before posting to the group.
>
> my fstab contains the correct lines. listing the mounts of a running
> colinux system shows that /dev/shm is indeed mounted.
>
> - mela
>
> On 10/7/05, *Henry Nestler* < Henry.Ne@arcor.de
> <mailto:Henry.Ne@arcor.de>> wrote:
>
>
>
>     Mela Custodining wrote:
>      > Good day,
>      >
>      > Recently I had the chance to use an application, which uses IPC, on
>      > coLinux. It uses shared memory. I am using the Gentoo 2Gb images. I'm
>      > using 0.6.3 stable snapshots, WinPCAP-bridges, and using cofs.
>      >
>      > When I run the binaries in coLinux the IPC calls failed, particulary
>      > shm_init failing with ENOSYS. (I have pshared == 1)
>      >
>      > When I run the binaries on a Shrike machine, the application
>     executes
>      > properly.
>      >
>      > Before I go out build my own custom vmlinux (as a last resort) I
>     would
>      > like to ask those knowledgeable than me if the kernel shipped coLinux
>      > supports IPC. Is rebuilding a new vmlinux the solution to my
>     problems?
>      > Your inputs would be highly appreciated.
>      >
>      > - mela
>
>     Have you mount the shm device?
>
>      > mount | grep shm
>     tmpfs on /dev/shm type tmpfs (rw)
>
>
>     If not, try this before you start your program:
>      > mount -t tmpfs tmpfs /dev/shm
>
>     --
>     Henry Nestler
>
>

--
Henry Nestler