Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

return the address of a shared memory location

Posted on 1998-04-17
2
Medium Priority
?
256 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
[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
2 Comments
 

Author Comment

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

Accepted Solution

by:
jpk041897 earned 600 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
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…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.
Suggested Courses

636 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