Print this page
5258 Incorrect range specified in mq_send(3c) manual
   1 '\" te

   2 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
   3 .\" Copyright 1989 AT&T
   4 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
   5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
   6 .\" http://www.opengroup.org/bookstore/.
   7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
   8 .\"  This notice shall appear on any product containing this material.
   9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
  10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
  11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
  12 .TH MQ_SEND 3C "Feb 5, 2008"
  13 .SH NAME
  14 mq_send, mq_timedsend, mq_reltimedsend_np \- send a message to a message queue
  15 .SH SYNOPSIS
  16 .LP
  17 .nf
  18 #include <mqueue.h>
  19 
  20 \fBint\fR \fBmq_send\fR(\fBmqd_t\fR \fImqdes\fR, \fBconst char *\fR\fImsg_ptr\fR, \fBsize_t\fR \fImsg_len\fR,
  21      \fBunsigned\fR \fImsg_prio\fR);
  22 .fi
  23 
  24 .LP
  25 .nf
  26 #include <mqueue.h>
  27 #include <time.h>
  28 
  29 \fBint\fR \fBmq_timedsend\fR(\fBmqd_t\fR \fImqdes\fR, \fBconst char *\fR\fImsg_ptr\fR,
  30      \fBsize_t\fR \fImsg_len\fR, \fBunsigned\fR \fImsg_prio\fR,
  31      \fBconst struct timespec *restrict\fR \fIabs_timeout\fR);
  32 .fi
  33 
  34 .LP
  35 .nf
  36 \fBint\fR \fBmq_reltimedsend_np\fR(\fBmqd_t\fR \fImqdes\fR, \fBconst char *\fR\fImsg_ptr\fR,
  37      \fBsize_t\fR \fImsg_len\fR, \fBunsigned\fR \fImsg_prio\fR,
  38      \fBconst struct timespec *restrict\fR \fIrel_timeout\fR);
  39 .fi
  40 
  41 .SH DESCRIPTION
  42 .sp
  43 .LP
  44 The \fBmq_send()\fR function adds the message pointed to by the argument
  45 \fImsg_ptr\fR to the message queue specified by \fImqdes\fR. The \fImsg_len\fR
  46 argument specifies the length of the message in bytes pointed to by
  47 \fImsg_ptr\fR. The value of \fImsg_len\fR is less than or equal to the
  48 \fImq_msgsize\fR attribute of the message queue, or \fBmq_send()\fR fails.
  49 .sp
  50 .LP
  51 If the specified message queue is not full, \fBmq_send()\fR behaves as if the
  52 message is inserted into the message queue at the position indicated by the
  53 \fImsg_prio\fR argument. A message with a larger numeric value of
  54 \fImsg_prio\fR is inserted before messages with lower values of \fImsg_prio\fR.
  55 A message will be inserted after other messages in the queue, if any, with
  56 equal \fImsg_prio\fR. The value of \fImsg_prio\fR must be greater than zero and
  57 less than or equal to  \fBMQ_PRIO_MAX\fR.
  58 .sp
  59 .LP
  60 If the specified message queue is full and \fBO_NONBLOCK\fR is not set in the
  61 message queue description associated with \fImqdes\fR (see \fBmq_open\fR(3C)
  62 and \fBmq_setattr\fR(3C)), \fBmq_send()\fR blocks until space becomes available
  63 to enqueue the message, or until \fBmq_send()\fR is interrupted by a signal. If
  64 more than one thread is waiting to send when space becomes available in the
  65 message queue, then the thread of the highest priority which has been waiting
  66 the longest is unblocked to send its message. Otherwise, it is unspecified
  67 which waiting thread is unblocked. If the specified message queue is full and
  68 \fBO_NONBLOCK\fR is set in the message queue description associated with
  69 \fImqdes\fR, the message is not queued and \fBmq_send()\fR returns an error.
  70 .sp
  71 .LP
  72 The \fBmq_timedsend()\fR function adds a message to the message queue specified
  73 by \fImqdes\fR in the manner defined for the \fBmq_send()\fR function. However,
  74 if the specified message queue is full and \fBO_NONBLOCK\fR is not set in the
  75 message queue description associated with \fImqdes\fR, the wait for sufficient
  76 room in the queue is terminated when the specified timeout expires. If
  77 \fBO_NONBLOCK\fR is set in the message queue description, this function is


   1 '\" te
   2 .\" Copyright (c) 2014, Ryan Zezeski.
   3 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
   4 .\" Copyright 1989 AT&T
   5 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
   6 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
   7 .\" http://www.opengroup.org/bookstore/.
   8 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
   9 .\"  This notice shall appear on any product containing this material.
  10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
  11 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
  12 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
  13 .TH MQ_SEND 3C "Oct 23, 2014"
  14 .SH NAME
  15 mq_send, mq_timedsend, mq_reltimedsend_np \- send a message to a message queue
  16 .SH SYNOPSIS
  17 .LP
  18 .nf
  19 #include <mqueue.h>
  20 
  21 \fBint\fR \fBmq_send\fR(\fBmqd_t\fR \fImqdes\fR, \fBconst char *\fR\fImsg_ptr\fR, \fBsize_t\fR \fImsg_len\fR,
  22      \fBunsigned\fR \fImsg_prio\fR);
  23 .fi
  24 
  25 .LP
  26 .nf
  27 #include <mqueue.h>
  28 #include <time.h>
  29 
  30 \fBint\fR \fBmq_timedsend\fR(\fBmqd_t\fR \fImqdes\fR, \fBconst char *\fR\fImsg_ptr\fR,
  31      \fBsize_t\fR \fImsg_len\fR, \fBunsigned\fR \fImsg_prio\fR,
  32      \fBconst struct timespec *restrict\fR \fIabs_timeout\fR);
  33 .fi
  34 
  35 .LP
  36 .nf
  37 \fBint\fR \fBmq_reltimedsend_np\fR(\fBmqd_t\fR \fImqdes\fR, \fBconst char *\fR\fImsg_ptr\fR,
  38      \fBsize_t\fR \fImsg_len\fR, \fBunsigned\fR \fImsg_prio\fR,
  39      \fBconst struct timespec *restrict\fR \fIrel_timeout\fR);
  40 .fi
  41 
  42 .SH DESCRIPTION
  43 .sp
  44 .LP
  45 The \fBmq_send()\fR function adds the message pointed to by the argument
  46 \fImsg_ptr\fR to the message queue specified by \fImqdes\fR. The \fImsg_len\fR
  47 argument specifies the length of the message in bytes pointed to by
  48 \fImsg_ptr\fR. The value of \fImsg_len\fR is less than or equal to the
  49 \fImq_msgsize\fR attribute of the message queue, or \fBmq_send()\fR fails.
  50 .sp
  51 .LP
  52 If the specified message queue is not full, \fBmq_send()\fR behaves as
  53 if the message is inserted into the message queue at the position
  54 indicated by the \fImsg_prio\fR argument. A message with a larger
  55 numeric value of \fImsg_prio\fR is inserted before messages with lower
  56 values of \fImsg_prio\fR.  A message will be inserted after other
  57 messages in the queue, if any, with equal \fImsg_prio\fR. The value of
  58 \fImsg_prio\fR must range from zero to \fBMQ_PRIO_MAX - 1\fR.
  59 .sp
  60 .LP
  61 If the specified message queue is full and \fBO_NONBLOCK\fR is not set in the
  62 message queue description associated with \fImqdes\fR (see \fBmq_open\fR(3C)
  63 and \fBmq_setattr\fR(3C)), \fBmq_send()\fR blocks until space becomes available
  64 to enqueue the message, or until \fBmq_send()\fR is interrupted by a signal. If
  65 more than one thread is waiting to send when space becomes available in the
  66 message queue, then the thread of the highest priority which has been waiting
  67 the longest is unblocked to send its message. Otherwise, it is unspecified
  68 which waiting thread is unblocked. If the specified message queue is full and
  69 \fBO_NONBLOCK\fR is set in the message queue description associated with
  70 \fImqdes\fR, the message is not queued and \fBmq_send()\fR returns an error.
  71 .sp
  72 .LP
  73 The \fBmq_timedsend()\fR function adds a message to the message queue specified
  74 by \fImqdes\fR in the manner defined for the \fBmq_send()\fR function. However,
  75 if the specified message queue is full and \fBO_NONBLOCK\fR is not set in the
  76 message queue description associated with \fImqdes\fR, the wait for sufficient
  77 room in the queue is terminated when the specified timeout expires. If
  78 \fBO_NONBLOCK\fR is set in the message queue description, this function is