LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   C - How do you use shmget()? (https://www.linuxquestions.org/questions/programming-9/c-how-do-you-use-shmget-794098/)

golmschenk 03-08-2010 09:29 PM

C - How do you use shmget()?
 
I've found some information on shmget() but all that I've found is written in a way that I'm having trouble understanding. Can anyone explain how to use it in a fairly simplistic way and give an example? Thanks a bunch!

grail 03-08-2010 09:35 PM

This looked fairly straight forward:

http://publib.boulder.ibm.com/infoce...pp_shmget.html

golmschenk 03-08-2010 10:33 PM

Great that did help. Now I"m using something along the lines of:
Code:

shared_bookmarks = shmget(Book_Key, MAX_BOOKMARKS * sizeof(bookmarks), (0644 | IPC_CREAT));
Using this, how can I put a string into the shared memory and have it accessible via an ID number or the key?

Thanks again!


All times are GMT -5. The time now is 05:57 PM.