problems with shared memory area

R

Ron Eggler

Hi,

I'm running an application on an embedded PC 104 platform on a Linux OS.
I need some shared memory and I'm trying to create it with:
int prg_shm = ::shmget(0x1999,sizeof(struct configuration),0666);
if (prg_shm == -1)
{
prg_shm = ::shmget(0x1999,sizeof(struct configuration),IPC_CREAT|0666);
if (prg_shm == -1)
{
std::cerr << "Failed to create shared memory area!\n";
::exit(EXIT_FAILURE);
}
}

But I always get ""Failed to create shared memory area!" and I'm not seeing
what's wrong. Any suggestions?

Thanks!
Ron
 
V

Victor Bazarov

Ron said:
I'm running an application on an embedded PC 104 platform on a Linux
OS.
I need some shared memory and I'm trying to create it with:
int prg_shm = ::shmget(0x1999,sizeof(struct
configuration),0666); if (prg_shm == -1)
{
prg_shm = ::shmget(0x1999,sizeof(struct
configuration),IPC_CREAT|0666); if (prg_shm == -1)
{
std::cerr << "Failed to create shared memory
area!\n"; ::exit(EXIT_FAILURE);
}
}

But I always get ""Failed to create shared memory area!" and I'm not
seeing
what's wrong. Any suggestions?

Post to a Linux newsgroup, where this would be on topic.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top