473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

problems with shared memory area

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
--
chEErs roN
Mar 4 '08 #1
1 1800
Ron Eggler wrote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Mar 4 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Claudio Grondi | last post by:
Background information: --------------------------------- in order to monitor mainboard sensory data as fan speeds, temperatures, applications like SpeedFan http://www.almico.com/speedfan.php or...
11
by: Michael Schuler | last post by:
The use of STL in shared memory poses a real problem since (non-smart) pointers are not allowed there. Is there any solution for containers in shared memory using smart pointers? Where can I...
14
by: phil_gg04 | last post by:
Dear C++ Experts, Over the last couple of months I have been writing my first program using shared memory. It has been something of an "in-at-the-deep-end" experience, to say the least. At...
1
by: Mehmet Turker | last post by:
Hi; In a research project, I want to use shared memory with semaphores. First I have to create an environment for interprocess messaging. I'm thinking of having a main process which creates a big...
9
by: Jon Davis | last post by:
I really don't like the speed bottleneck of SOAP. Is it possible to have shared memory, without using networking calls, within .NET? It seems like even though protected memory was a godsend for...
33
by: wespvp | last post by:
When I try to run thread_test.c from the CVS tip, it hangs in an infinite CPU loop on both linux (RedHat AS 3.0, gcc 3.2.3) and Mac OS X 10.3.3 (gcc 3.3). I've also tried down to gcc 2.96 on Mac...
2
by: Ravi | last post by:
I have several apps (some written in VB6, others in VB.NET) that need to be able to see the same area of memory (shared memory), in particular an array. I know that I can use win api calls...
10
by: Oriane | last post by:
Hello, I have to share a object in RAM between several processes. I intend to design a special process to load this objet (an Autocad plan) in memory, and to take care of the read/write...
5
by: Sune | last post by:
Hi all, I want to make data stored in-memory (not disk) available to several processes. My concern is that poorly written C applications with dangling pointers may(will) damage the data in this...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.