hello, I try to test the POSIX mq_open function on book unp like below:
./a.out /test.1234
It works ok but I can't find where is the created mq-file(test.1234)? Does anybody know the default directory? thanks.
I am using ubuntu 10.04
Hello,
J work on a HP.
I want to create message queue by using mq_open with this parameters:
mq_open(p,O_CREAT|O_WRONLY|O_EXCL|0_NONBLOCK,0600,&queue_attr)
with p char
and the function returns the value -1 and errno equal 2.
can you help me ?
Thank. (3 Replies)
Hello,
My question is related to "pipcs -qa" command under HP-UX 11i PA-RISC 64 bits.
We have a little C program that creates posix ipc message queues using the mq_open() system function.
The program fail with 'No space left on device' error when we create big queues. What is the system... (6 Replies)
Hello,
i need to write a message queue "chat server", that should work only localy.
Can anyone please help me with some ideas and peshaps code. I'm studying the UNIX IPC mechanisms right now. So far, i understand how it works but i still cannot get an idea how to write a chat programm...
... (2 Replies)
Hi all,
Please tell me how to change POSIX message queue maximum size? "ulimit" is not a solution because it controls shell resources. But i need to control queue size before login in and starting the shell. It is needed to limit queue size for applications started before login in.
Sorry for my... (7 Replies)
Hii can anyone pls tell how to limit the max no of message in a posix message queue. I have made changes in proc/sys/fs/mqueue/msg_max
But still whenever i try to read the value of max. message in the queue using attr.mq_curmsgs (where struct mq_attr attr) its giving the default value as 10.... (0 Replies)
Hello,
I am trying to implement posix message queue application. I am faced with an error on the mq_receive section. It says "Message too long". I've tried couple of small tweeks, but to no result. Please do suggest any rectificaitons.
mq_send section-works successfully
#include... (2 Replies)
Hi all,
First of all thanks in advance for reading my post and for your heart for helping me.
I am trying to create a message queue using mq_open(name,oflags,mode_t,attr) method. But that function call is returning with an error code EFAULT. By googling it I found that it happens when there is... (10 Replies)
in a single main() function,so need signal handling. Use Posix Message Queue IPC mechanism , can ignore the priority and other linked list message,to implement the scenario:
client:Knock Knock
server:who's there
client: Eric
Server:Eric,Welcome.
client:exit
all process terminated
... (1 Reply)
Hi,
I wanted to know whether the POSIX message queues are statically allocated memory by the kernel based on the parameters specified in the open or as and when we send messages, memory are allocated?
Does the kernel reserve the specified memory for the message queue irrespective of whether... (1 Reply)
Discussion started by: sumtata
1 Replies
LEARN ABOUT SUNOS
mq_close
mq_close(3RT) Realtime Library Functions mq_close(3RT)NAME
mq_close - close a message queue
SYNOPSIS
cc [ flag... ] file... -lrt [ library... ]
#include <mqueue.h>
int mq_close(mqd_t mqdes);
DESCRIPTION
The mq_close() function removes the association between the message queue descriptor, mqdes, and its message queue. The results of using
this message queue descriptor after successful return from this mq_close(), and until the return of this message queue descriptor from a
subsequent mq_open(3RT), are undefined.
If the process (or thread) has successfully attached a notification request to the message queue via this mqdes, this attachment is removed
and the message queue is available for another process to attach for notification.
RETURN VALUES
Upon successful completion, mq_close() returns 0; otherwise, the function returns -1 and sets errno to indicate the error condition.
ERRORS
The mq_close() function will fail if:
EBADF The mqdes argument is an invalid message queue descriptor.
ENOSYS The mq_open() function is not supported by the system.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO mqueue.h(3HEAD), mq_notify(3RT), mq_open(3RT), mq_unlink(3RT), attributes(5), standards(5)NOTES
Solaris 2.6 was the first release to support the Asynchronous Input and Output option. Prior to this release, this function always returned
-1 and set errno to ENOSYS.
SunOS 5.10 28 Jun 2002 mq_close(3RT)