OSDN Git Service

(split) LDP: Update original to LDP v3.65
[linuxjm/LDP_man-pages.git] / original / man3 / mq_receive.3
index 04ecd64..642bcf5 100644 (file)
@@ -1,8 +1,7 @@
 '\" t
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -22,8 +21,9 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
-.TH MQ_RECEIVE 3 2010-02-25 "Linux" "Linux Programmer's Manual"
+.TH MQ_RECEIVE 3 2014-01-18 "Linux" "Linux Programmer's Manual"
 .SH NAME
 mq_receive, mq_timedreceive \- receive a message from a message queue
 .SH SYNOPSIS
@@ -31,18 +31,29 @@ mq_receive, mq_timedreceive \- receive a message from a message queue
 .B #include <mqueue.h>
 .sp
 .BI "ssize_t mq_receive(mqd_t " mqdes ", char *" msg_ptr ,
-.BI "                   size_t " msg_len ", unsigned *" msg_prio );
+.BI "                   size_t " msg_len ", unsigned int *" msg_prio );
 .sp
-.B #define _XOPEN_SOURCE 600
 .B #include <time.h>
 .B #include <mqueue.h>
 .sp
 .BI "ssize_t mq_timedreceive(mqd_t " mqdes ", char *" msg_ptr ,
-.BI "                   size_t " msg_len ", unsigned *" msg_prio ,
+.BI "                   size_t " msg_len ", unsigned int *" msg_prio ,
 .BI "                   const struct timespec *" abs_timeout );
 .fi
 .sp
 Link with \fI\-lrt\fP.
+.sp
+.ad l
+.in -4n
+Feature Test Macro Requirements for glibc (see
+.BR feature_test_macros (7)):
+.in
+.sp
+.BR mq_timedreceive ():
+.RS 4
+_XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L
+.RE
+.ad
 .SH DESCRIPTION
 .BR mq_receive ()
 removes the oldest message with the highest priority from
@@ -54,12 +65,12 @@ The
 .I msg_len
 argument specifies the size of the buffer pointed to by
 .IR msg_ptr ;
-this must be greater than the
+this must be greater than or equal to the
 .I mq_msgsize
 attribute of the queue (see
 .BR mq_getattr (3)).
 If
-.I prio
+.I msg_prio
 is not NULL, then the buffer to which it points is used
 to return the priority associated with the received message.
 
@@ -150,13 +161,20 @@ On Linux,
 is a system call, and
 .BR mq_receive ()
 is a library function layered on top of that system call.
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR mq_close (3),
 .BR mq_getattr (3),
 .BR mq_notify (3),
 .BR mq_open (3),
 .BR mq_send (3),
 .BR mq_unlink (3),
-.BR feature_test_macros (7),
 .BR mq_overview (7),
 .BR time (7)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.