?
Solved

return the address of a shared memory location

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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