ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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.
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....
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.
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.