OSDN Git Service

f33fdbc3f63ac359513fb0cfe58e915a896a8788
[linuxjm/LDP_man-pages.git] / original / man3 / mq_close.3
1 '\" t
2 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\"
4 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .TH MQ_CLOSE 3 2010-08-29 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 mq_close \- close a message queue descriptor
29 .SH SYNOPSIS
30 .nf
31 .B #include <mqueue.h>
32 .sp
33 .BI "int mq_close(mqd_t " mqdes );
34 .fi
35 .sp
36 Link with \fI\-lrt\fP.
37 .SH DESCRIPTION
38 .BR mq_close ()
39 closes the message queue descriptor
40 .IR mqdes .
41
42 If the calling process has attached a notification request
43 to this message queue via
44 .IR mqdes ,
45 then this request is removed,
46 and another process can now attach a notification request.
47 .SH RETURN VALUE
48 On success
49 .BR mq_close ()
50 returns 0; on error, \-1 is returned, with
51 .I errno
52 set to indicate the error.
53 .SH ERRORS
54 .TP
55 .B EBADF
56 The descriptor specified in
57 .I mqdes
58 is invalid.
59 .SH CONFORMING TO
60 POSIX.1-2001.
61 .SH NOTES
62 All open message queues are automatically closed on process termination,
63 or upon
64 .BR execve (2).
65 .SH "SEE ALSO"
66 .BR mq_getattr (3),
67 .BR mq_notify (3),
68 .BR mq_open (3),
69 .BR mq_receive (3),
70 .BR mq_send (3),
71 .BR mq_unlink (3),
72 .BR mq_overview (7)