?
Solved

Shmget Fail

Posted on 2004-07-30
1
Medium Priority
?
288 Views
Last Modified: 2010-04-21
Hello expert,

  I am trying to create a section of share memory using

shmget((key_t)1234, sizeof(struct shared_use_st), 0666 | IPC_CREAT);

it return ok if the size I want to create is around 552 (printf("Size:%d", sizeof(struct shared_use_st));

However shmget() return -1 if the size of the structure is increase to 560.

I do a "free" command on my console and it shows I should have 10.9M free RAM

          total          used     free
mem: 14844        3900     10944

Any suggestion?
0
Comment
Question by:sctccomm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 45

Accepted Solution

by:
sunnycoder earned 2000 total points
ID: 11683191
if ( shmget((key_t)1234, sizeof(struct shared_use_st), 0666 | IPC_CREAT) < 0 )
     perror ("shmget error:");

add this perror statement .. this will tell you the cause of failure and its code ... More details of the code can be found at the shmget man page
man shmget
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question