Solved

return the address of a shared memory location

Posted on 1998-04-17
2
247 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
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 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.

862 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

25 Experts available now in Live!

Get 1:1 Help Now