Symbolic Links and shm_open

I found again something i do not understand.

The following is a fact:

/linktowd → /home/user/wd

created by: ln -s /home/user/wd /linktowd

Application is started via IDE (remote on winhost) and with an Working Directory set to /linktowd
Now i open an shared memory object via
shm_open(“mysharedmem”, O_RDWR | O_CREAT, 0777 ) ;

This is ftruncate later to set to my wanted size and can be worked with by my process now.

The funny thing is now:

ls -lsa /linktowd/ reports:
nrwxrwxrwx 4 root root 24522212 mysharedmem

ls -lsa /home/user/wd/ reports


Pretty bad, since, i spawn more processes trying to work on that shared mem, but they use /home/user/wd/mysharedmem, or try to use :stuck_out_tongue:

I put it now directly to to an not-link-dir

But i want to understand why the shared mem is not shown in both.

With QNX 6, name spaces can be overrided. That is essentially what you have done.
You have a link (a special file) in the file systems name space, which is being overrided by your shared memory mount.
If you set your working directory to /home/user/wd, I think that both ls /home/user/wd and
/ls /linktowd will see the shared object.