LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-20-2005, 05:23 AM   #1
gdipierro
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Rep: Reputation: 0
Posix Message queues?


Where can I find Posix Message Queues?

I am running Red Hat Linux with the libgcc.a date being feb of 2003.
Is mqueue.h supposed to be there or is it in a later release?

Thanks.
 
Old 07-20-2005, 10:34 AM   #2
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
I don't think they are technically POSIX message queues, but try looking at 'man msgget' and 'man msgsnd'
 
Old 07-20-2005, 10:51 AM   #3
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
Hello,

I'm not sure about your Linux release, but mqueue.h exists in /usr/include on my Fedora Core 3 based system. I am also able to man the various mq_* functions so I know that the POSIX message queues are supported.
 
Old 07-22-2005, 07:46 AM   #4
gdipierro
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks,
I found that I need glibc 2.3.4 (after 4/12/04). This RH 9 dist dated 2/2003 needs to be updated. I guess I either need fedora or RH enterprise.
 
Old 07-22-2005, 10:24 AM   #5
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
Cool, glad that you were able to solve your problem. I am enjoying FC3. It seems to be very stable in the machines that I have installed it on (3 completely different systems, plus others that people at work are using). My work is "targeting" FC3 as the "recommended" distro for all of our Linux based server products.

Good luck with your project!
 
Old 07-22-2005, 04:56 PM   #6
jfitzger68
LQ Newbie
 
Registered: Jul 2005
Location: San Rafael, CA, USA
Distribution: Cygwin, FedoraCore 4
Posts: 18

Rep: Reputation: 0
Question

I have FedoraCore 4 and I cannot find library support for the POSIX message queues. I know I have mqueue.h and I can link with the pthread library, but I cannot even find any documentation on which library the message queue services are in....

Josh Sandeman
San Francisco
 
Old 07-22-2005, 05:01 PM   #7
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
jfitzger68, what happens if you "man mq_open"? On FC3 I get the man page for the POSIX message queue open function.
 
Old 07-22-2005, 05:08 PM   #8
jfitzger68
LQ Newbie
 
Registered: Jul 2005
Location: San Rafael, CA, USA
Distribution: Cygwin, FedoraCore 4
Posts: 18

Rep: Reputation: 0
I get the man pages for all of the POSIX functions, and all of the include files are present where they should be. Now, to use threads someone explained to me that I need to explicitly include the pthread library using the gcc switch -lpthread, but this obviously does not include the mqueue functions as I get link errors for those. But I cannot find any reference on the Internet to which library those are contained in!
 
Old 07-25-2005, 04:13 PM   #9
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
jfitzger68, I found the POSIX message queue functions for my FC3 based system. They are in /usr/lib/librt.* So, just adding -lrt to your link step should get them included. Try it and see what happens. BTW: libpthread is only good for the POSIX threads library, not the POSIX message queues.
 
Old 07-25-2005, 04:22 PM   #10
jfitzger68
LQ Newbie
 
Registered: Jul 2005
Location: San Rafael, CA, USA
Distribution: Cygwin, FedoraCore 4
Posts: 18

Rep: Reputation: 0
Talking

Aha! That worked like a champ! Thanks so much for your help!

Josh
 
Old 07-25-2005, 04:26 PM   #11
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
Cool! Glad to have helped!

So how is the weather up in the city? It is HOT down here in San Jose, and the building's air conditioner is on the fritz
 
Old 07-25-2005, 04:34 PM   #12
jfitzger68
LQ Newbie
 
Registered: Jul 2005
Location: San Rafael, CA, USA
Distribution: Cygwin, FedoraCore 4
Posts: 18

Rep: Reputation: 0
It's not too bad up here... mid to upper 70s, I'd say. Sorry to hear you are roasting down in SJ. I'm not a heat person, myself. Cool Autumn days in New England is my favorite weather.
 
Old 07-25-2005, 04:42 PM   #13
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
Yup, I remember (I grew up in Conn). You could taste Autumn in the air when is was just cool enough, but not too cold yet.

Ciao!
 
Old 07-25-2005, 06:08 PM   #14
jfitzger68
LQ Newbie
 
Registered: Jul 2005
Location: San Rafael, CA, USA
Distribution: Cygwin, FedoraCore 4
Posts: 18

Rep: Reputation: 0
Sorry to bug you again. My program compiles and links, yet I get a "permission denied" runtime error when attempting to create a message queue. This happens even when I am running the program as root. None of the code examples I have seem do anything special and look pretty much like mine. Any ideas?
 
Old 07-26-2005, 09:43 AM   #15
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
Sorry, but my knowledge of POSIX message queues is many, many years old. The last time that I attempted to use POSIX message queues was when I was writing a real-time embedded application running on top of QNX. I needed a message queue mechanism and all they supported was the POSIX message queues. The implementation used disk files as the actual queue mechanism, and I needed to run in a read-only DOC type of system, so I was forced to write my own RAM based message queue system...

Why don't you post your relevant open/creation code and I will see if anything seems obvious to me.
 
  


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
POSIX message queues(Solaris) to SYS V message queues(Linux) devershetty Programming 1 01-22-2007 10:15 AM
message queues - please some checkup from the pros kirmet Programming 4 09-20-2005 08:40 AM
Message Queues rag_mg Programming 1 05-08-2005 08:00 AM
POSIX message queues... infamous41md Programming 6 05-25-2004 02:53 PM
Message Queues BoldKiller Programming 1 05-28-2003 05:40 PM

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

All times are GMT -5. The time now is 09:13 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