mq_close(3) Library Functions Manual mq_close(3)NAME
mq_close - Closes a message queue (P1003.1b)
LIBRARY
Realtime Library (librt.so, librt.a)
SYNOPSIS
#include <mqueue.h>
int mq_close (
mqd_t mqdes);
PARAMETERS
mqdes Specifies a message queue descriptor.
DESCRIPTION
The mq_close function closes a message queue. This function removes the association between the message queue descriptor, mqdes, and its
open message queue description. When all message queue descriptors associated with an open message queue description have been closed, the
associated open message queue description is removed. The message associated with the message queue will then be deleted if mq_unlink was
already called, or is called after all processes have closed the queue.
RETURN VALUES
On successful completion, the function returns the value 0 (zero); otherwise, the function returns the value -1 and sets errno to indicate
the error.
ERRORS
The mq_close function fails under the following conditions:
[EBADF] The mqdes argument is an invalid message queue descriptor.
[EFAULT] An internal virtual memory error occurred.
RELATED INFORMATION
Functions: mq_open(3), mq_unlink(3)
Guide to Realtime Programming delim off
mq_close(3)
Check Out this Related Man Page
mq_close(2) System Calls Manual mq_close(2)NAME
mq_close - close a message queue descriptor
SYNOPSIS DESCRIPTION
The system call removes the association between the message queue descriptor, mqdes, and a message queue. Use of this message queue
descriptor by the process, after a successful return from this and until this descriptor is returned by a subsequent will result in the
failure of message queue system calls, with set to
If the process has a registered notification request with the message queue associated with this mqdes, the registration is canceled and
the queue becomes available for another process to register a notification request.
If the message queue has been unlinked and mqdes is the only existing open descriptor for the queue, the queue is destroyed.
To use this function, link in the realtime library by specifying on the compiler or linker command line.
RETURN VALUE
returns the following values:
Successful completion.
Failure.
is set to indicate the error.
ERRORS
If fails, is set to one of the following values:
mqdes is not a valid message queue descriptor.
is not supported by the implementation.
SEE ALSO mq_open(2), mq_unlink(2), mq_notify(2).
STANDARDS CONFORMANCE mq_close(2)
Hi there:
Thanks first. When I use a message queue amony severl processes, will I have to synchronize the queue? I don't think I would have to because a message queue is implemented in a link listed. Correct me If I am wrong... (0 Replies)
hi all,
I'm working on this problem for 2 days. Can somebody tell me that how to delete all message queues from the system ?
Since "ipcs -q" gives the list of all existing message queue, then there must be a system call and data stucture where from I can fetch the data about all existing... (2 Replies)
i have been in trouble please help me out
i have developed a message queue.it is a simple message queue program
after running it give error like NO SPACE LEFT ON DEVICE
what is this error
how could i solve this problem i am working on solaris9.2 (2 Replies)
I am sending and retriving the message to the queue
the problem is
after retrieving the message can i see what is there in my message queue.
(actually in my application i am encountring some garbage value)
so i want to retieve this garbage value and also want to know its size
how... (0 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)
hello ,
I have to write an application in which I had to implement both Socket Comminication and IPC- message queues.
and that process should run in Infinite loop as well I had to continously check and send data through both type of communications...
What should I use to implement it...
I had... (34 Replies)
my squid running on openBSD 4.1
i have dns_childern 32
but i m facing a problem of queue overloading
cache.log shows this error message...
dnsSubmit: queue overload, rejecting xxxxxxxxxx
dnsSubmit: queue overload, rejecting xxxxxxxxxx
dnsSubmit: queue overload, rejecting xxxxxxxxxx... (0 Replies)
hi
I am using posix functions such as mq_open, mq_close and including the mqueue.h. but its giving a linking error,"undefined reference to mq_open and mq_close".
it it that we have to link some library or so while compiling... plzzz help
Thanxs
Mohit (0 Replies)
Hi!!
This code works if I don't remove the message queue.
In A.c I create 3 processes that send a message in a message queue.
in B.c other 3 processes receive 1 message for each (the messages sent from A), change the value of "dato" and put again the message in the queue.
The processes in A.c... (0 Replies)
Hi,
I browsed thru the previous posts and couldnt find a solution for my problem. Hence I decided to post it.
I have a buffer array that I want to send thru a message queue. The array consists of a header structure and a payload structure memcopied to it. When I print the contents of the... (1 Reply)
Such as how to display these:
number of message queue IDs : 4,096
bytes per message : 8,192
bytes per message queue : 65,536
messages per message queue : 8,192 (4 Replies)
I find from Stivenson (Advanced Programming Unix Environment) "How to send file descriptor by system queue"
I make next code
int size;
int p_count;
int shmid;
char *ptr;
char *shmptr;
shmid_ds ds;
key_t key = ftok("db.pid", 1 );
if (key < 0){
printf( ... (2 Replies)
Hi guys.
i have wrote a simple program to test message queue attributes. here it is:
#include <stdio.h>
#include <stdlib.h>
#include <mqueue.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
int main()
{
struct mq_attr attr;
mqd_t mqd;
... (2 Replies)