problem compiling when using shm_open()

Posted by: skibum

problem compiling when using shm_open() - 10/01/2003 10:12

I'm trying to write a program for my empeg. So I installed Mark Lord's prebuilt cross compiler. All worked fine.

My problem is trying to compile a program that uses shm_open(). I'm using gcc pshm.c -o pshm -lrt (as I would for i386).

The errors I'm getting are as if I've not specified the -lrt :-

$ gcc pshm.c -o pshm -lrt
pshm.c: In function `main':
pshm.c:24: warning: comparison between pointer and integer
/tmp/ccUpLN92.o: In function `main':
/tmp/ccUpLN92.o(.text+0x20): undefined reference to `shm_open'
/tmp/ccUpLN92.o(.text+0xcc): undefined reference to `shm_unlink'
collect2: ld returned 1 exit status

So I'm assuming that its not in librt for the arm version?

Anyone got any pointers? or just it just not exist on the empeg version of linux? (if so, back to ipcsysV)
Posted by: pim

Re: problem compiling when using shm_open() - 10/01/2003 11:08

I believe both the standard and hijack kernels are built without shared memory support.

You would have to compile your own kernel to get it in.

Pim
Posted by: skibum

Re: problem compiling when using shm_open() - 10/01/2003 11:26

thanks for that Pim.

That said, I did really want to use posix shared memory and the fact I couldn't compile it just confused me.

As posix shared memory just uses mmap() which is supported seems odd I can't compile my little program.

Maybe I just need a newer librt.so?

I did a little sysV shared memory test and that failed as expected.
Posted by: tman

Re: problem compiling when using shm_open() - 13/01/2003 17:15

Yeah. SysV IPC is turned off in the stock and hijack kernels.
The libraries on your system for some reason doesn't have shm_open and shm_close. No idea why. I've not tried to use SHM on the Empeg.

- Trevor