LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-08-2010, 09:29 PM   #1
golmschenk
Member
 
Registered: Nov 2009
Posts: 144

Rep: Reputation: 15
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!
 
Old 03-08-2010, 09:35 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
This looked fairly straight forward:

http://publib.boulder.ibm.com/infoce...pp_shmget.html
 
Old 03-08-2010, 10:33 PM   #3
golmschenk
Member
 
Registered: Nov 2009
Posts: 144

Original Poster
Rep: Reputation: 15
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!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] shmget(lowmem) error: Unknown error 999 kaz2100 Linux - Software 1 10-26-2010 04:11 AM
shmget returns invalid segment size specified BobS0327 Programming 1 11-08-2006 01:49 PM
shmget() returns the different ID for the same key lordofring Programming 3 08-28-2006 11:42 AM
After exiting Fluxbox I get: shmget (lowmem) error hubabuba Slackware 1 03-07-2006 12:05 PM
cdrecord: Function not implemented. shmget failed rksanders Debian 3 12-10-2004 04:04 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration