⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mqpxlib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 2 页
字号:
is inserted into the message queue at the position indicated by the <i>msgPrio</i> argument.  A message with a higher numeric value for <i>msgPrio</i>is inserted before messages with a lower value.  The valueof <i>msgPrio</i> must be less than or equal to 31.<p>If the specified message queue is full and <b>O_NONBLOCK</b> is not set in themessage queue's, <b><a href="./mqPxLib.html#mq_send">mq_send</a>(&nbsp;)</b> will block until space becomes available toqueue the message, or until it is interrupted by a signal.  The priorityscheduling option is supported in the event that there is more than onetask waiting on space becoming available.  If the message queue is fulland <b>O_NONBLOCK</b> is set in the message queue's description, the message isnot queued, and <b><a href="./mqPxLib.html#mq_send">mq_send</a>(&nbsp;)</b> returns an error.<p></blockquote><h4>USE BY INTERRUPT SERVICE ROUTINES</h4><blockquote><p>This routine can be called by interrupt service routines as well asby tasks.  This is one of the primary means of communicationbetween an interrupt service routine and a task.  If <b><a href="./mqPxLib.html#mq_send">mq_send</a>(&nbsp;)</b>is called from an interrupt service routine, it will behave as ifthe <b>O_NONBLOCK</b> flag were set.<p></blockquote><h4>RETURNS</h4><blockquote><p>0 (OK), otherwise -1 (ERROR).<p></blockquote><h4>ERRNO</h4><blockquote><p>EAGAIN, EBADF, EINTR, EINVAL, EMSGSIZE<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mqPxLib.html#top">mqPxLib</a></b>, <b><a href="./mqPxLib.html#mq_receive">mq_receive</a>(&nbsp;)</b><hr><a name="mq_close"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>mq_close(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>mq_close(&nbsp;)</strong> - close a message queue (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int mq_close    (    mqd_t mqdes               /* message queue descriptor */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is used to indicate that the calling task is finishedwith the specified message queue <i>mqdes</i>.  The <b><a href="./mqPxLib.html#mq_close">mq_close</a>(&nbsp;)</b> call deallocates any system resources allocated by the system for use by this task for its message queue.The behavior of a task that is blocked on either a <b><a href="./mqPxLib.html#mq_send">mq_send</a>(&nbsp;)</b> or<b><a href="./mqPxLib.html#mq_receive">mq_receive</a>(&nbsp;)</b> is undefined when <b><a href="./mqPxLib.html#mq_close">mq_close</a>(&nbsp;)</b> is called.The <i>mqdes</i> parameter will no longer be a valid message queue ID.<p></blockquote><h4>RETURNS</h4><blockquote><p>0 (OK) if the message queue is closed successfully,otherwise -1 (ERROR).<p></blockquote><h4>ERRNO</h4><blockquote><p>EBADF<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mqPxLib.html#top">mqPxLib</a></b>, <b><a href="./mqPxLib.html#mq_open">mq_open</a>(&nbsp;)</b><hr><a name="mq_unlink"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>mq_unlink(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>mq_unlink(&nbsp;)</strong> - remove a message queue (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int mq_unlink    (    const char * mqName       /* name of message queue */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes the message queue named by the pathname <i>mqName</i>.After a successful call to <b><a href="./mqPxLib.html#mq_unlink">mq_unlink</a>(&nbsp;)</b>, a call to <b><a href="./mqPxLib.html#mq_open">mq_open</a>(&nbsp;)</b> on the samemessage queue will fail if the flag <b>O_CREAT</b> is not set.  If one or moretasks have the message queue open when <b><a href="./mqPxLib.html#mq_unlink">mq_unlink</a>(&nbsp;)</b> is called, removal ofthe message queue is postponed until all references to the message queuehave been closed.<p></blockquote><h4>RETURNS</h4><blockquote><p>0 (OK) if the message queue is unlinked successfully,otherwise -1 (ERROR).<p></blockquote><h4>ERRNO</h4><blockquote><p>ENOENT<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mqPxLib.html#top">mqPxLib</a></b>, <b><a href="./mqPxLib.html#mq_close">mq_close</a>(&nbsp;)</b>, <b><a href="./mqPxLib.html#mq_open">mq_open</a>(&nbsp;)</b><hr><a name="mq_notify"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>mq_notify(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>mq_notify(&nbsp;)</strong> - notify a task that a message is available on a queue (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int mq_notify    (    mqd_t                   mqdes,        /* message queue descriptor */    const struct sigevent * pNotification /* real-time signal */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>If <i>pNotification</i> is not NULL, this routine attaches the specified<i>pNotification</i> request by the calling task to the specified message queue<i>mqdes</i> associated with the calling task.  The real-time signal specifiedby <i>pNotification</i> will be sent to the task when the message queue changesfrom empty to non-empty.  If a task has already attached a notificationrequest to the message queue, all subsequent attempts to attach anotification to the message queue will fail.  A task is able to attach asingle notification to each <i>mqdes</i> it has unless another task has alreadyattached one.<p>If <i>pNotification</i> is NULL and the task has previously attached anotification request to the message queue, the attached notificationrequest is detached and the queue is available for another task to attacha notification request.<p>If a notification request is attached to a message queue and any taskis blocked in <b><a href="./mqPxLib.html#mq_receive">mq_receive</a>(&nbsp;)</b> waiting to receive a message when a messagearrives at the queue, then the appropriate <b><a href="./mqPxLib.html#mq_receive">mq_receive</a>(&nbsp;)</b> will be completedand the notification request remains pending.<p></blockquote><h4>RETURNS</h4><blockquote><p>0 (OK) if successful, otherwise -1 (ERROR).<p></blockquote><h4>ERRNO</h4><blockquote><p>EBADF, EBUSY, EINVAL<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mqPxLib.html#top">mqPxLib</a></b>, <b><a href="./mqPxLib.html#mq_open">mq_open</a>(&nbsp;)</b>, <b><a href="./mqPxLib.html#mq_send">mq_send</a>(&nbsp;)</b><hr><a name="mq_setattr"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>mq_setattr(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>mq_setattr(&nbsp;)</strong> - set message queue attributes (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int mq_setattr    (    mqd_t                  mqdes,     /* message queue descriptor */    const struct mq_attr * pMqStat,   /* new attributes */    struct mq_attr *       pOldMqStat /* old attributes */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets attributes associated with the specified messagequeue <i>mqdes</i>.<p>The message queue attributes corresponding to the following membersdefined in the <b>mq_attr</b> structure are set to the specified values uponsuccessful completion of the call:<dl><dt><b>mq_flags</b><dd>The value the <b>O_NONBLOCK</b> flag.</dl><p>If <i>pOldMqStat</i> is non-NULL, <b><a href="./mqPxLib.html#mq_setattr">mq_setattr</a>(&nbsp;)</b> will store, in thelocation referenced by <i>pOldMqStat</i>, the previous message queue attributesand the current queue status.  These values are the same as would be returnedby a call to <b><a href="./mqPxLib.html#mq_getattr">mq_getattr</a>(&nbsp;)</b> at that point.<p></blockquote><h4>RETURNS</h4><blockquote><p>0 (OK) if attributes are set successfully, otherwise -1 (ERROR).<p></blockquote><h4>ERRNO</h4><blockquote><p>EBADF<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mqPxLib.html#top">mqPxLib</a></b>, <b><a href="./mqPxLib.html#mq_open">mq_open</a>(&nbsp;)</b>, <b><a href="./mqPxLib.html#mq_send">mq_send</a>(&nbsp;)</b>, <b><a href="./mqPxLib.html#mq_getattr">mq_getattr</a>(&nbsp;)</b><hr><a name="mq_getattr"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>mq_getattr(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>mq_getattr(&nbsp;)</strong> - get message queue attributes (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int mq_getattr    (    mqd_t            mqdes,   /* message queue descriptor */    struct mq_attr * pMqStat  /* buffer in which to return attributes */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets status information and attributes associated with aspecified message queue <i>mqdes</i>.  Upon return, the following members ofthe <b>mq_attr</b> structure referenced by <i>pMqStat</i> will contain the valuesset when the message queue was created but with modifications made bysubsequent calls to <b><a href="./mqPxLib.html#mq_setattr">mq_setattr</a>(&nbsp;)</b>:<dl><dt><b>mq_flags</b><dd>May be modified by <b><a href="./mqPxLib.html#mq_setattr">mq_setattr</a>(&nbsp;)</b>.</dl><p>The following were set at message queue creation:<dl><dt><b>mq_maxmsg</b><dd>Maximum number of messages.<dt><b>mq_msgsize</b><dd>Maximum message size.</dl><p><dl><dt><b>mq_curmsgs</b><dd>The number of messages currently in the queue.</dl><p></blockquote><h4>RETURNS</h4><blockquote><p>0 (OK) if message attributes can be determined, otherwise -1 (ERROR).<p></blockquote><h4>ERRNO</h4><blockquote><p>EBADF<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mqPxLib.html#top">mqPxLib</a></b>, <b><a href="./mqPxLib.html#mq_open">mq_open</a>(&nbsp;)</b>, <b><a href="./mqPxLib.html#mq_send">mq_send</a>(&nbsp;)</b>, <b><a href="./mqPxLib.html#mq_setattr">mq_setattr</a>(&nbsp;)</b></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -