亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mqpxlib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* mqPxLib.c - message queue library (POSIX) *//* Copyright 1984-2002 Wind River Systems, Inc.  */#include "copyright_wrs.h"/*modification history--------------------01s,17jul00,jgn  merge DOT-4 pthreads changes01r,29sep00,pai  added Andrew Gaiarsa's fix for mq_send() during kernelState                 (SPR #32033)01q,16oct96,dgp  doc: modify mq_send to show maximum priority <= 31 		      (SPR #7019)01p,19aug96,dbt  added use of MQ_PRIO_MAX (SPR #7039).01o,11feb95,jdi  corrected spelling error.01n,25jan95,rhp  doc tweaks.    19jan95,jdi  doc cleanup.01m,15apr94,dvs  fix mq_send to unlock interrupts on error.	   +rrr01l,08apr94,dvs  doc cleanup of mq_close (SPR #3099).01k,08apr94,dvs  fixed error in args when calling symFindByName (SPR #3090).01j,03feb94,kdl  moved structure definitions to mqPxLibP.h.01i,01feb94,dvs  documentation changes.01h,30jan94,kdl  changed #if for conditional ffsMsb() prototype (!=I960).01g,28jan94,kdl  added check for invalid msg and queue sizes in mq_open().01f,28jan94,dvs  fixed i960 ffsMsb() problem01e,24jan94,smb  added instrumentation macros01d,12jan94,rrr  fixed bug sending message to self; change to follow wrs 	   +kdl  coding conventions; change mqLibInit() to mqPxLibInit().01c,21dec93,kdl	 fixed errno if opening non-existant queue.01b,12nov93,rrr	 rewrite01a,06apr93,smb	 created*//*DESCRIPTIONThis library implements the message-queue interface defined in thePOSIX 1003.1b standard, as an alternative to the VxWorks-specificmessage queue design in msgQLib.  These message queues are accessedthrough names; each message queue supports multiple sending and receiving tasks.The message queue interface imposes a fixed upper bound on the size ofmessages that can be sent to a specific message queue.  The size is set onan individual queue basis.  The value may not be changed dynamically.This interface allows a task be notified asynchronously of theavailability of a message on the queue.  The purpose of this feature is tolet the task to perform other functions and yet still be notified that amessage has become available on the queue.MESSAGE QUEUE DESCRIPTOR DELETIONThe mq_close() call terminates a message queue descriptor anddeallocates any associated memory.  When deleting message queuedescriptors, take care to avoid interfering with other tasks that areusing the same descriptor.  Tasks should only close messagequeue descriptors that the same task has opened successfully.The routines in this library conform to POSIX 1003.1b.INCLUDE FILES: mqueue.hSEE ALSO: POSIX 1003.1b document, msgQLib,.pG "Basic OS"*/#include "vxWorks.h"#include "errno.h"#include "stdarg.h"#include "string.h"#include "intLib.h"#include "qLib.h"#include "fcntl.h"#include "objLib.h"#include "taskLib.h"#include "semLib.h"#include "private/mqPxLibP.h"#include "private/sigLibP.h"#include "private/kernelLibP.h"#include "private/windLibP.h"#include "private/workQLibP.h"#include "private/eventP.h"#include "symLib.h"#include "memLib.h"#define __PTHREAD_SRC#include "pthread.h"#if CPU_FAMILY != I960extern int ffsMsb (unsigned long);	/* not in any header except for i960 */#endif#undef FREAD#undef FWRITE#define FREAD	1#define FWRITE	2static OBJ_CLASS 	mqClass;CLASS_ID 		mqClassId = &mqClass;SYMTAB_ID 		mqNameTbl;BOOL 			mqLibInstalled = FALSE;#ifdef __GNUC__#define INLINE	__inline__#else#define INLINE#endif/********************************************************************************* sll_ins - insert into a singly linked list** These list have the following form:** ---------* | head  |-------------* ---------             \*                        \*          ----------     \   ----------      ----------        ----------*      ,-->| New - 1|-------->| Newest |----->| Oldest |--~~~-->|        |-*     /    ----------         ----------      ----------        ---------- \*     \____________________________________________________________________/** To insert, put it after the Newest and move the head up one.*/static INLINE void sll_ins    (    struct sll_node *   pNode,		/* node to insert */    struct sll_node **  ppHead		/* addr of head of list */    )    {    if (*ppHead == NULL)	*ppHead = pNode->sll_next = pNode;    else	{	pNode->sll_next = (*ppHead)->sll_next;	(*ppHead)->sll_next = pNode;	*ppHead = pNode;	}    }/********************************************************************************* sll_head - remove the oldest node off a singly linked list** These list have the following form:** ---------* | head  |-------------* ---------             \*                        \*          ----------     \   ----------      ----------        ----------*      ,-->| New - 1|-------->| Newest |------| Oldest |--~~~-->|        |-*     /    ----------         ----------      ----------        ---------- \*     \____________________________________________________________________/** To remove, pull off the one after the Newest, then make sure there are* still some nodes left otherwise null out the head.** RETURNS: A pointer to the oldest node.*/static INLINE struct sll_node *sll_head    (    struct sll_node ** ppHead		/* addr of head of list */    )    {    struct sll_node *pRetval;    if ((pRetval = (*ppHead)->sll_next) == *ppHead)	*ppHead = NULL;    else	(*ppHead)->sll_next = pRetval->sll_next;    return (pRetval);    }/********************************************************************************* mqPxLibInit - initialize the POSIX message queue library** This routine initializes the POSIX message queue facility.  If <hashSize> is* 0, the default value is taken from MQ_HASH_SIZE_DEFAULT.** RETURNS: OK or ERROR.*/int mqPxLibInit    (    int hashSize		/* log2 of number of hash buckets */    )    {    if (!mqLibInstalled)	{	if (hashSize == 0)	    hashSize = MQ_HASH_SIZE_DEFAULT;	if (((mqNameTbl = symTblCreate (hashSize, FALSE, memSysPartId)) != NULL)	    && (classInit (mqClassId, sizeof (struct mq_des),			  OFFSET (struct mq_des, f_objCore),			  (FUNCPTR) NULL,(FUNCPTR) NULL,(FUNCPTR) NULL) == OK))	    mqLibInstalled = TRUE;	}    return (mqLibInstalled) ? OK : ERROR;    }/********************************************************************************* mq_init - quick and dirty init of the guts of a message queue.** The needs to be redone with objects!!! XXX**/static void mq_init    (    void *	pMem,		/* memory to hold queue */    int		nMsgs,		/* number of messages in queue */    int		msgSize		/* size of each message */    )    {    struct sll_node *pNode;    struct msg_que *pMq;    size_t nBytes;    nBytes = MEM_ROUND_UP (msgSize + sizeof (struct sll_node));    pMq = (struct msg_que *) pMem;    bzero ((void *) pMq, sizeof (struct msg_que));    qInit (&pMq->msgq_cond_read, Q_PRI_LIST, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);    qInit (&pMq->msgq_cond_data, Q_PRI_LIST, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);    pMq->msgq_sigTask		= -1;    pMq->msgq_attr.mq_maxmsg	= nMsgs;    pMq->msgq_attr.mq_msgsize	= msgSize;    pNode = (struct sll_node *) (void *) ((char *)pMem +	    MEM_ROUND_UP (sizeof (struct msg_que)));    while (nMsgs-- > 0)	{	sll_ins (pNode, &pMq->msgq_free_list);	pNode = (struct sll_node *) (void *) ((char *)pNode + nBytes);	}    }/********************************************************************************* mq_terminate - quick and dirty termination of the guts of a message queue.** The needs to be redone with objects!!! XXX**/static void mq_terminate    (    struct msg_que *pMq    )    {    kernelState = TRUE;			/* ENTER KERNEL */    /* windview - level 2 instrumentation */    EVT_TASK_1 (EVENT_OBJ_MSGDELETE, pMq);    windPendQTerminate (&pMq->msgq_cond_read);    /* windview - level 2 instrumentation */    EVT_TASK_1 (EVENT_OBJ_MSGDELETE, pMq);    windPendQTerminate (&pMq->msgq_cond_data);    windExit ();			/* EXIT KERNEL */    /*     * notification processing     */    if (pMq->msgq_sigTask != -1)	{	sigPendDestroy (&pMq->msgq_sigPend);	pMq->msgq_sigTask = -1;	}    free (pMq);    }/********************************************************************************* mq_create - create a message queue** The function mq_create() is used to create a message queue.  The maximum* size of any message that can be sent is <msgSize>.  The message queue* can hold <nMsgs> messages before a mq_send() will block.** RETURNS: Upon successful completion, mq_create() will return a* message queue descriptor.  Otherwise, the function will return (<mqd_t>)-1* and set <errno> to indicate the error.** ERRORS: If any of the following conditions occur, the mq_create() function* will return (<mqd_t>)-1 and set <errno> to the corresponding value:* .iP ENOMEM** NOMANUAL*/mqd_t mq_create    (    size_t nMsgs,		/* number of messages in queue */    size_t msgSize		/* size of each message in queue */    )    {    struct mq_des	*pMqDesc;    void		*pQMem;    if (INT_RESTRICT () != OK)	return ((mqd_t) -1);	/* restrict ISR from calling */    if ((!mqLibInstalled) && (mqPxLibInit (0) != OK))	return ((mqd_t) -1);	/* package init problem */    pQMem = malloc (MEM_ROUND_UP (sizeof (struct msg_que)) + 	        nMsgs * MEM_ROUND_UP (msgSize + sizeof (struct sll_node)));    if (pQMem == NULL)	{	errno = ENOSPC;	return ((mqd_t) -1);	}    if ((pMqDesc = (mqd_t) objAlloc (mqClassId)) == NULL)	{	free (pQMem);       	errno = ENOSPC;       	return ((mqd_t) -1);	}    mq_init (pQMem, nMsgs, msgSize);    pMqDesc->f_flag = FREAD | FWRITE;    pMqDesc->f_data = pQMem;    pMqDesc->f_data->msgq_links++;    objCoreInit (&pMqDesc->f_objCore, mqClassId);	/* valid file obj */    return (pMqDesc);    }/********************************************************************************* mq_open - open a message queue (POSIX)** This routine establishes a connection between a named message queue and the* calling task.  After a call to mq_open(), the task can reference the* message queue using the address returned by the call.  The message queue* remains usable until the queue is closed by a successful call to mq_close().** The <oflags> argument controls whether the message queue is created or merely* accessed by the mq_open() call.  The following flag bits can be set* in <oflags>:* .iP O_RDONLY* Open the message queue for receiving messages.  The task can use the * returned message queue descriptor with mq_receive(), but not mq_send().* .iP O_WRONLY* Open the message queue for sending messages.  The task can use the* returned message queue descriptor with mq_send(), but not mq_receive().* .iP O_RDWR* Open the queue for both receiving and sending messages.  The task can use* any of the functions allowed for O_RDONLY and O_WRONLY.* .LP** Any combination of the remaining flags can be specified in <oflags>:* .iP O_CREAT* This flag is used to create a message queue if it does not already exist.* If O_CREAT is set and the message queue already exists, then O_CREAT has* no effect except as noted below under O_EXCL.  Otherwise, mq_open()* creates a message queue.  The O_CREAT flag requires a third and fourth* argument: <mode>, which is of type `mode_t', and <pAttr>, which is of type* pointer to an `mq_attr' structure.  The value of <mode> has no effect in* this implementation.  If <pAttr> is NULL, the message queue is created* with implementation-defined default message queue attributes.  If <pAttr>* is non-NULL, the message queue attributes `mq_maxmsg' and `mq_msgsize' are* set to the values of the corresponding members in the `mq_attr' structure* referred to by <pAttr>; if either attribute is less than or equal to zero,* an error is returned and errno is set to EINVAL.* .iP O_EXCL* This flag is used to test whether a message queue already exists.* If O_EXCL and O_CREAT are set, mq_open() fails if the message queue name* exists.* .iP O_NONBLOCK* The setting of this flag is associated with the open message queue descriptor* and determines whether a mq_send() or mq_receive() will wait for resources* or messages that are not currently available, or fail with errno set * to EAGAIN.  * .LP** The mq_open() call does not add or remove messages from the queue.** NOTE:* Some POSIX functionality is not yet supported:**     - A message queue cannot be closed with calls to _exit() or exec().*     - A message queue cannot be implemented as a file.*     - Message queue names will not appear in the file system.** RETURNS: A message queue descriptor, otherwise -1 (ERROR).** ERRNO: EEXIST, EINVAL, ENOENT, ENOSPC** SEE ALSO: mq_send(), mq_receive(), mq_close(), mq_setattr(), mq_getattr(),* mq_unlink()**/ mqd_t mq_open    (    const char	*mqName,	/* name of queue to open */    int		oflags,		/* open flags */    ...				/* extra optional parameters */    )    {    va_list		vaList;		/* arg list (if O_CREAT) */    struct mq_des *	pMqDesc;	/* memory for queue descriptor */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本不卡视频一二三区| 久久综合精品国产一区二区三区| 激情综合网激情| 亚洲成av人片一区二区三区| 亚洲色图欧洲色图| 亚洲四区在线观看| 亚洲另类在线一区| 1024成人网色www| 国产精品福利一区| 国产精品白丝在线| 一区二区三区精品在线观看| 亚洲国产精品尤物yw在线观看| 亚洲欧美日韩在线| 亚洲综合激情网| 日韩国产欧美在线视频| 蜜桃一区二区三区在线观看| 麻豆精品国产传媒mv男同| 麻豆一区二区三区| 国产91精品免费| 91日韩一区二区三区| 一本到三区不卡视频| 欧美在线高清视频| 欧美一区二区三区播放老司机| 91精品国产美女浴室洗澡无遮挡| 日韩欧美国产成人一区二区| 久久人人爽人人爽| 亚洲色图19p| 舔着乳尖日韩一区| 国产成人高清在线| 欧美性猛交xxxxxx富婆| 7777精品伊人久久久大香线蕉的 | 五月天激情综合| 日本最新不卡在线| 国产成人三级在线观看| 成人av网站在线观看| 欧美日韩视频在线第一区 | 91精品国产综合久久精品| 欧美一区二区三区四区高清| 久久精品一区二区三区不卡| 亚洲欧美一区二区三区国产精品| 亚洲.国产.中文慕字在线| 国产美女在线观看一区| 日本韩国一区二区| 久久一区二区三区四区| 亚洲高清免费观看| 成人在线一区二区三区| 在线播放亚洲一区| 国产精品久久久久aaaa樱花 | 亚洲色图丝袜美腿| 久久99久久99精品免视看婷婷| 91在线国内视频| 日韩欧美在线网站| 亚洲成人免费av| 99久久婷婷国产综合精品电影| 91精品免费观看| 一片黄亚洲嫩模| 国产99精品在线观看| 日韩欧美亚洲国产另类| 亚洲国产另类av| 色综合色综合色综合| 国产三级欧美三级日产三级99| 午夜久久福利影院| 在线一区二区三区做爰视频网站| 国产性天天综合网| 精东粉嫩av免费一区二区三区| 欧美三级视频在线播放| 亚洲欧洲日产国产综合网| 激情欧美一区二区三区在线观看| 欧美日韩成人一区| 亚洲最新视频在线播放| 成人一区二区三区中文字幕| 久久久久99精品一区| 精品午夜久久福利影院 | 国产午夜精品福利| 国产主播一区二区三区| 欧美一区二区三区免费在线看| 亚洲六月丁香色婷婷综合久久| 99国产一区二区三精品乱码| 中文在线一区二区| 成人黄色777网| 综合久久久久久| 99精品久久免费看蜜臀剧情介绍| 国产精品嫩草影院av蜜臀| 国产成人超碰人人澡人人澡| 久久免费视频色| 国产激情精品久久久第一区二区 | 国产精品免费av| 国产精品18久久久久久vr| 日韩精品一区二区三区在线观看| 亚洲高清视频的网址| 欧美日韩久久久| 日韩在线播放一区二区| 91精品国模一区二区三区| 久久精品国产成人一区二区三区| 欧美不卡一区二区三区四区| 国产一区二区三区免费播放| 久久免费的精品国产v∧| 成人午夜激情影院| 一区二区三区四区国产精品| 欧洲一区在线电影| 男女激情视频一区| 久久亚洲私人国产精品va媚药| 成人综合婷婷国产精品久久蜜臀| 亚洲免费观看在线观看| 6080日韩午夜伦伦午夜伦| 国精产品一区一区三区mba桃花| 国产喷白浆一区二区三区| 91浏览器打开| 日韩成人一级大片| 久久久久99精品一区| 色综合视频一区二区三区高清| 亚洲一区二区三区国产| 精品处破学生在线二十三| 99riav一区二区三区| 奇米综合一区二区三区精品视频| 精品国产精品一区二区夜夜嗨| 成人av先锋影音| 日本va欧美va精品| 中文字幕亚洲一区二区va在线| 4438x亚洲最大成人网| 成人av综合一区| 日本伊人精品一区二区三区观看方式| ww久久中文字幕| 欧美日韩高清一区| 91在线视频官网| 国产美女一区二区三区| 日韩国产高清影视| 一区二区三区四区在线| 欧美国产亚洲另类动漫| 日韩丝袜情趣美女图片| 欧美亚日韩国产aⅴ精品中极品| 国产精品伊人色| 日本大胆欧美人术艺术动态| 最新国产の精品合集bt伙计| 久久精品一区二区| 日韩一区二区三区四区五区六区| 色综合久久综合中文综合网| 国产91丝袜在线播放0| 极品少妇xxxx偷拍精品少妇| 日韩精品欧美精品| 亚洲制服丝袜av| 国产精品久久久久久一区二区三区 | 91日韩精品一区| 国产美女av一区二区三区| 免费看日韩精品| 日韩国产精品大片| 午夜精品福利一区二区蜜股av| 一区二区三区四区国产精品| 亚洲欧洲另类国产综合| 国产精品久久久久久久久图文区 | 中文字幕av不卡| 国产亚洲一二三区| 日韩免费视频线观看| 欧美老女人在线| 91小视频在线| 国产成a人无v码亚洲福利| 亚洲大型综合色站| 一区二区国产视频| 亚洲一区二区三区不卡国产欧美 | 国产一区二区不卡| 狠狠色丁香久久婷婷综合_中| 精品写真视频在线观看| 国产最新精品免费| 国产精品1024久久| 国产·精品毛片| 99精品视频一区二区| 欧美三日本三级三级在线播放| 欧美日韩国产系列| 制服丝袜在线91| 日韩精品一区二区三区视频播放 | 在线综合亚洲欧美在线视频| 欧美日韩的一区二区| 在线综合+亚洲+欧美中文字幕| 欧美大片一区二区| 国产精品人妖ts系列视频| 亚洲精品成人少妇| 日本亚洲电影天堂| 国产成人精品1024| 在线观看亚洲专区| 日韩精品一区二区三区蜜臀| 久久久久9999亚洲精品| 亚洲男人的天堂在线观看| 日韩精品电影一区亚洲| 国产精品69久久久久水密桃| 91小视频免费看| 精品伦理精品一区| 欧美日韩国产bt| 欧美日韩美少妇 | 亚洲国产精品激情在线观看| 中文字幕亚洲综合久久菠萝蜜| 亚洲午夜激情网页| 国产乱子伦视频一区二区三区| 色欧美片视频在线观看在线视频| 欧美日本国产视频| 国产精品欧美一级免费| 青青青伊人色综合久久| 97se亚洲国产综合自在线观| 日韩欧美国产电影| 亚洲国产精品嫩草影院| 国产jizzjizz一区二区|