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. |
I don't think they are technically POSIX message queues, but try looking at 'man msgget' and 'man msgsnd'
|
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. |
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. |
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! |
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 |
jfitzger68, what happens if you "man mq_open"? On FC3 I get the man page for the POSIX message queue open function.
|
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!
|
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.
|
Aha! That worked like a champ! Thanks so much for your help!
Josh |
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 :mad: |
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.
|
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! |
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?
|
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. |
All times are GMT -5. The time now is 07:33 AM. |