Solved

return the address of a shared memory location

Posted on 1998-04-17
2
241 Views
Last Modified: 2010-04-21
I need the address of a shared memory location.  All I have is the key_t - is there anyway to get the shmid from this information?
0
Comment
Question by:ethornsb
2 Comments
 

Author Comment

by:ethornsb
ID: 2006257
Adjusted points to 300
0
 
LVL 6

Accepted Solution

by:
jpk041897 earned 300 total points
ID: 2006258
Use:

void *shmat(int shmid, void*shmaddr, int shmflag);

smid is obtained via a call to

int shmget(key_t key, int size, int shmflag);

and shmaddr should be (void *)0 for your purposes.

shmat will return a pointer to the shared memory segment.

See shmop(2) and shmget(2) in the Programmers Reference manual for more info.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now