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

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

?? mqpxlib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
    struct mq_attr *	pAttr;		/* pointer to attr passed in */    void *		pQMem;		/* memory queue will be placed in */    mode_t		mode;		/* not used by vxWorks */    int			nMsgs;		/* number of messages in queue */    int			msgSize;	/* size of each message in queue */    int			nBytes;		/* amount of mem needed for queue */    SYM_TYPE		dummy;		/* dummy var for symFindByName */    if (INT_RESTRICT () != OK)	/* restrict ISR from calling */	return ((mqd_t) -1);    if ((!mqLibInstalled) && (mqPxLibInit (0) != OK))	return ((mqd_t) -1);	/* package init problem */    if ((oflags & 3) == 3)	{	errno = EINVAL;	return ((mqd_t) -1);	}    semTake (&mqNameTbl->symMutex, WAIT_FOREVER);    if (symFindByName (mqNameTbl, (char *) mqName, (char **)&pQMem,                        &dummy) == OK)	{	/*	 * Found a mq, see if we should use it	 */	if (O_EXCL & oflags)	    {	    semGive (&mqNameTbl->symMutex);	    errno = EEXIST;	    return ((mqd_t) -1);	    }	if ((pMqDesc = (mqd_t) objAlloc (mqClassId)) == NULL)	    {	    semGive (&mqNameTbl->symMutex);	    errno = ENOSPC;	    return ((mqd_t) -1);	    }	}    else	{	/*	 * There was no mq, create one if asked	 */	if (!(O_CREAT & oflags))	    {	    semGive (&mqNameTbl->symMutex);	    errno = ENOENT;	    return ((mqd_t) -1);		/* queue does not exist */	    }	va_start (vaList, oflags);	mode = va_arg (vaList, mode_t);	pAttr = va_arg (vaList, struct mq_attr *);	va_end (vaList);	if (pAttr != NULL)	    {	    nMsgs = pAttr->mq_maxmsg;	    msgSize = pAttr->mq_msgsize;	    if ((nMsgs <= 0) || (msgSize <= 0))		{	    	semGive (&mqNameTbl->symMutex);	    	errno = EINVAL;	    	return ((mqd_t) -1);		/* invalid size specified */	    	}	    oflags |= (pAttr->mq_flags & O_NONBLOCK);	    }	else	    {	    nMsgs =   MQ_NUM_MSGS_DEFAULT;	    msgSize = MQ_MSG_SIZE_DEFAULT;	    }	nBytes = MEM_ROUND_UP (sizeof(struct msg_que)) + 		 nMsgs * MEM_ROUND_UP (msgSize + sizeof (struct sll_node));	pQMem = malloc (nBytes + strlen (mqName) + 1);	if (pQMem == 0)	    {	    semGive (&mqNameTbl->symMutex);	    errno = ENOSPC;	    return ((mqd_t) -1);	    }	mq_init (pQMem, nMsgs, msgSize);	((struct msg_que *) pQMem)->msgq_sym.name = (char *) pQMem + nBytes;	((struct msg_que *) pQMem)->msgq_sym.value = (char *) pQMem;	strcpy ((char *)pQMem + nBytes, mqName);	if ((pMqDesc = (mqd_t) objAlloc (mqClassId)) == NULL)	    {	    free (pQMem);	    semGive (&mqNameTbl->symMutex);	    errno = ENOSPC;	    return ((mqd_t) -1);	    }	symTblAdd (mqNameTbl, &((struct msg_que *) pQMem)->msgq_sym);	}    /*     * (oflags & 3) + 1 is magic for transposing O_RDONLY, O_RDWR or     * O_WRONLY into the bit field flags FREAD and FWRITE     */    pMqDesc->f_flag = (oflags & O_NONBLOCK) | ((oflags & 3) + 1);    pMqDesc->f_data = pQMem;    pMqDesc->f_data->msgq_links++;    objCoreInit (&pMqDesc->f_objCore, mqClassId);	/* valid file obj */    semGive (&mqNameTbl->symMutex);    return (pMqDesc);    }/********************************************************************************* mq_receive - receive a message from a message queue (POSIX)** This routine receives the oldest of the highest priority message from* the message queue specified by <mqdes>.  If the size of the buffer in* bytes, specified by the <msgLen> argument, is less than the `mq_msgsize'* attribute of the message queue, mq_receive() will fail and return an* error.  Otherwise, the selected message is removed from the queue and* copied to <pMsg>.** If <pMsgPrio> is not NULL, the priority of the selected message* will be stored in <pMsgPrio>.** If the message queue is empty and O_NONBLOCK is not set in the message* queue's description, mq_receive() will block until a message is added to* the message queue, or until it is interrupted by a signal.  If more than* one task is waiting to receive a message when a message arrives at an* empty queue, the task of highest priority that has been waiting the* longest will be selected to receive the message.  If the specified message* queue is empty and O_NONBLOCK is set in the message queue's description,* no message is removed from the queue, and mq_receive() returns an error.** RETURNS: The length of the selected message in bytes, otherwise -1 (ERROR). ** ERRNO: EAGAIN, EBADF, EMSGSIZE, EINTR** SEE ALSO: mq_send()*/ssize_t mq_receive    (    mqd_t	mqdes,		/* message queue descriptor */    void	*pMsg,		/* buffer to receive message */    size_t	msgLen,		/* size of buffer, in bytes */    int		*pMsgPrio	/* if not NULL, priority of message */    )    {    struct sll_node *pNode;    struct msg_que *pMq;    int status;    int level;    int prio;    int error = 0;    int savtype;    if (INT_RESTRICT () != OK)		/* restrict ISR from calling */	return (-1);    TASK_LOCK ();			/* TASK LOCK */    if ((OBJ_VERIFY (mqdes, mqClassId) != OK) ||	((mqdes->f_flag & FREAD) == 0))	{	error = EBADF;	goto bad;	}    pMq = mqdes->f_data;    /* Link into pthreads support code */    if (_func_pthread_setcanceltype != NULL)        {        _func_pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &savtype);        }    if (msgLen < pMq->msgq_attr.mq_msgsize)	{	error = EMSGSIZE;	goto bad;	}    level = intLock ();			/* LOCK INTERRUPTS */    if (pMq->msgq_bmap == 0)	{	if (mqdes->f_flag & O_NONBLOCK)	    {	    intUnlock (level);		/* UNLOCK INTERRUPTS */	    error = EAGAIN;	    goto bad;	    }	/*	 * This needs to be in a loop, the reason is that someone	 * can wake us up but we may not run.  During that time someone	 * else can come in and steal our message.	 */	while (pMq->msgq_bmap == 0)	    {	    kernelState = TRUE;		/* ENTER KERNEL */	    intUnlock (level);		/* UNLOCK INTERRUPTS */	    /* windview - level 2 instrumentation */            EVT_TASK_1 (EVENT_OBJ_MSGRECEIVE, pMq);	    if (windPendQPut (&pMq->msgq_cond_data, WAIT_FOREVER) != OK)		{		windExit ();			/* EXIT KERNEL */		error = EBADF;			/* what should ernno be??? */		goto bad;		}	    status = windExit ();		/* EXIT KERNEL */	    if (status != 0)		{		error = (status == RESTART) ? EINTR : EAGAIN;		goto bad;		}	    level = intLock ();		/* LOCK INTERRUPTS */	    }	}    prio = ffsMsb (pMq->msgq_bmap) - 1;    pNode = sll_head (&pMq->msgq_data_list[prio]);    --pMq->msgq_attr.mq_curmsgs;    if (pMq->msgq_data_list[prio] == NULL)	pMq->msgq_bmap &= ~(1 << prio);    intUnlock (level);			/* UNLOCK INTERRUPTS */    msgLen = pNode->sll_size;    bcopy ((void *) (pNode + 1), pMsg, msgLen);    if (pMsgPrio != 0)	*pMsgPrio = prio;    level = intLock ();			/* LOCK INTERRUPTS */    sll_ins (pNode, &pMq->msgq_free_list);    if (Q_FIRST (&pMq->msgq_cond_read) != 0)	{	kernelState = TRUE;		/* ENTER KERNEL */	intUnlock (level);		/* UNLOCK INTERRUPTS */	/* windview - level 2 instrumentation */        EVT_TASK_1 (EVENT_OBJ_MSGRECEIVE, pMq);	windPendQGet (&pMq->msgq_cond_read);	windExit ();			/* EXIT KERNEL */	}    else	intUnlock (level);		/* UNLOCK INTERRUPTS */bad:    TASK_UNLOCK();			/* TASK UNLOCK */    /* Link into pthreads support code */    if (_func_pthread_setcanceltype != NULL)        {        _func_pthread_setcanceltype(savtype, NULL);        }    if (error != 0)	{	errno = error;	return (-1);	}    return (msgLen);    }/********************************************************************************* mq_work - handle mq work** The routine is always done as work. It is needed because windPendQGet* does not check it the queue is empty.*/LOCAL void mq_work    (    struct msg_que *pMq,    int flag    )    {    if (Q_FIRST (&pMq->msgq_cond_data) != NULL)	{	/* windview - level 2 instrumentation */        EVT_TASK_1 (EVENT_OBJ_MSGSEND, pMq);	windPendQGet (&pMq->msgq_cond_data);	}    else if ((flag == 0) && (pMq->msgq_sigTask != -1))	{        /* SPR #32033         * An interrupt context is faked while executing sigPendKill().           * Since the work queue is drained with kernelState set to TRUE,         * sigPendKill() will perform an excJobAdd() of itself.  Without         * faking an interrupt context, the ensuing msgQSend() will perform         * taskLock/taskUnlock to protect it's critical section.  The          * taskUnlock() would then re-enter the kernel via windExit().         * The kernel cannot be re-entered while in the process of draining         * the work queue.         */   	++intCnt;     /* no need to lock interrupts around increment */	sigPendKill (pMq->msgq_sigTask, &pMq->msgq_sigPend);	--intCnt;     /* no need to lock interrupts around decrement */	pMq->msgq_sigTask = -1;	}    }/********************************************************************************* mq_send - send a message to a message queue (POSIX)** This routine adds the message <pMsg> to the message queue* <mqdes>.  The <msgLen> parameter specifies the length of the message in* bytes pointed to by <pMsg>.  The value of <pMsg> must be less than or* equal to the `mq_msgsize' attribute of the message queue, or mq_send()* will fail.** If the message queue is not full, mq_send() will behave as if the message* is inserted into the message queue at the position indicated by the * <msgPrio> argument.  A message with a higher numeric value for <msgPrio>* is inserted before messages with a lower value.  The value* of <msgPrio> must be less than or equal to 31.** If the specified message queue is full and O_NONBLOCK is not set in the* message queue's, mq_send() will block until space becomes available to* queue the message, or until it is interrupted by a signal.  The priority* scheduling option is supported in the event that there is more than one* task waiting on space becoming available.  If the message queue is full* and O_NONBLOCK is set in the message queue's description, the message is* not queued, and mq_send() returns an error.** USE BY INTERRUPT SERVICE ROUTINES* This routine can be called by interrupt service routines as well as* by tasks.  This is one of the primary means of communication* between an interrupt service routine and a task.  If mq_send()* is called from an interrupt service routine, it will behave as if* the O_NONBLOCK flag were set.** RETURNS: 0 (OK), otherwise -1 (ERROR).** ERRNO: EAGAIN, EBADF, EINTR, EINVAL, EMSGSIZE** SEE ALSO: mq_receive()*/int mq_send    (    mqd_t	mqdes,		/* message queue descriptor */    const void	*pMsg,		/* message to send */    size_t	msgLen,		/* size of message, in bytes */    int		msgPrio		/* priority of message */    )    {    struct sll_node *pNode;    struct msg_que *pMq;    int status;    int level;    int flag;    int sigTaskSave;		/* saved task id */    int error = 0;    int savtype;		/* saved cancellation type */    if (msgPrio > MQ_PRIORITY_MAX)	{	errno = EINVAL;	return (-1);	}    /* Link into pthreads support code */        if (_func_pthread_setcanceltype != NULL)        {        _func_pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &savtype);        }     if (!INT_CONTEXT ())	TASK_LOCK ();			/* TASK LOCK */    if ((OBJ_VERIFY (mqdes, mqClassId) != OK) ||	((mqdes->f_flag & FWRITE) == 0))	{	error = EBADF;	goto bad;	}    pMq = mqdes->f_data;    if (msgLen > pMq->msgq_attr.mq_msgsize)	{	error = EMSGSIZE;	goto bad;	}    level = intLock ();			/* LOCK INTERRUPTS */    if (pMq->msgq_free_list == NULL)	{	if (mqdes->f_flag & O_NONBLOCK)	    {	    intUnlock (level);		/* UNLOCK INTERRUPTS */	    error = EAGAIN;	    goto bad;	    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区精品| 香蕉久久夜色精品国产使用方法| 专区另类欧美日韩| 久久精品国产免费看久久精品| 99re这里只有精品首页| 欧美成人性战久久| 亚洲一二三专区| 色一情一伦一子一伦一区| 国产日韩欧美一区二区三区乱码 | 国产精品自拍毛片| 欧美日韩亚洲综合在线| 亚洲色图.com| 成人毛片在线观看| 久久精子c满五个校花| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美午夜片在线观看| 1024成人网色www| 国产成人av电影在线| 欧美变态tickle挠乳网站| 视频一区欧美精品| 日本韩国精品在线| 亚洲美女视频一区| 色偷偷成人一区二区三区91| 中文无字幕一区二区三区| 国产一区二区免费在线| 日韩欧美一区在线观看| 奇米色一区二区| 91.xcao| 水蜜桃久久夜色精品一区的特点 | 亚洲国产精品自拍| 日本高清无吗v一区| 亚洲黄色免费网站| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 国产精品自拍毛片| 国产欧美精品一区二区色综合| 国产精品77777竹菊影视小说| 久久久久国产精品麻豆| 国产一区中文字幕| 国产欧美日韩精品一区| 成人av动漫网站| 亚洲精品伦理在线| 欧美日韩国产综合一区二区| 日日夜夜精品视频免费| 日韩欧美不卡一区| 国产成人小视频| 亚洲男人天堂一区| 91精品国产品国语在线不卡| 麻豆国产91在线播放| 久久综合久久99| 91热门视频在线观看| 亚洲成人在线免费| 久久蜜臀精品av| 日本乱码高清不卡字幕| 日本亚洲天堂网| 国产精品午夜在线| 精品视频在线视频| 另类人妖一区二区av| 中文在线免费一区三区高中清不卡| 成人黄动漫网站免费app| 亚洲电影在线免费观看| 日韩精品中文字幕在线不卡尤物| 国产成人综合在线| 五月天丁香久久| 国产午夜精品福利| 欧美亚洲一区三区| 国产精品亚洲人在线观看| 一区二区三区在线播放| 久久综合色播五月| 日本高清视频一区二区| 狠狠久久亚洲欧美| 一区二区高清免费观看影视大全| 日韩精品一区二区三区四区| 99精品欧美一区二区三区综合在线| 亚洲bt欧美bt精品777| 国产精品天美传媒沈樵| 51精品国自产在线| www.亚洲人| 狠狠色丁香婷婷综合久久片| 亚洲午夜三级在线| 国产无人区一区二区三区| 欧美系列一区二区| 成人免费黄色在线| 国产专区欧美精品| 午夜精品久久久久影视| 国产精品超碰97尤物18| 2020国产精品自拍| 欧美精品aⅴ在线视频| 91丨九色丨尤物| 国产suv一区二区三区88区| 日韩成人dvd| 亚洲综合小说图片| 中文字幕亚洲不卡| 国产欧美综合在线观看第十页| 欧美一卡二卡三卡| 欧美日韩国产一级二级| 91首页免费视频| 国产91露脸合集magnet| 国产中文字幕精品| 麻豆专区一区二区三区四区五区| 亚洲国产精品一区二区久久 | 日韩国产欧美一区二区三区| 亚洲免费av在线| 综合中文字幕亚洲| 日本一区二区免费在线| 国产亚洲污的网站| 久久综合给合久久狠狠狠97色69| 91精品婷婷国产综合久久性色| 欧美色精品在线视频| 欧美性受极品xxxx喷水| 在线精品视频免费播放| 色视频欧美一区二区三区| 91小视频免费观看| 日本韩国欧美在线| 欧美影院一区二区| 欧美日韩国产综合视频在线观看| 欧美天堂亚洲电影院在线播放| 欧美三级在线看| 91精选在线观看| 精品少妇一区二区三区在线播放| 欧美一区二区人人喊爽| 日韩欧美亚洲国产精品字幕久久久 | 欧美三级电影网站| 在线观看日韩精品| 4438x亚洲最大成人网| 精品欧美乱码久久久久久1区2区 | 亚洲精品你懂的| 亚洲主播在线播放| 手机精品视频在线观看| 免费精品视频最新在线| 国产精品资源在线| av动漫一区二区| 欧美色电影在线| 欧美成人bangbros| 中文字幕不卡的av| 亚洲专区一二三| 久久激五月天综合精品| 粉嫩av一区二区三区在线播放| 成人av手机在线观看| 欧美性生活大片视频| 日韩欧美123| 亚洲天堂福利av| 麻豆国产精品视频| 波多野洁衣一区| 欧美日韩在线不卡| 国产亚洲自拍一区| 一区二区三区波多野结衣在线观看 | 亚洲第一激情av| 久久97超碰色| 99re亚洲国产精品| 欧美一级专区免费大片| 国产精品久久久久天堂| 午夜国产精品影院在线观看| 国产精品一区二区无线| 欧美视频日韩视频在线观看| 久久亚洲综合色| 亚洲图片一区二区| 国产成人亚洲精品青草天美| 欧美色窝79yyyycom| 久久精品亚洲麻豆av一区二区| 亚洲欧美一区二区久久| 国产一区三区三区| 欧美三区在线观看| 国产精品入口麻豆九色| 奇米777欧美一区二区| 91欧美激情一区二区三区成人| 欧美肥大bbwbbw高潮| 亚洲欧美另类小说| 国产黄色91视频| 日韩欧美www| 日日夜夜免费精品| 色呦呦国产精品| 国产精品国产三级国产专播品爱网| 蜜桃一区二区三区在线观看| 一本大道av伊人久久综合| 久久综合资源网| 久久精品国产99| 欧美一级免费观看| 亚洲精选视频在线| 成人午夜精品一区二区三区| 精品国产91九色蝌蚪| 日韩成人av影视| 在线不卡中文字幕播放| 亚洲国产一区二区视频| 色菇凉天天综合网| 亚洲欧美成aⅴ人在线观看| 福利视频网站一区二区三区| 久久久亚洲精华液精华液精华液| 免费在线观看一区| 91麻豆精品国产91久久久久| 亚洲综合激情小说| 91视频.com| 亚洲免费在线看| 日本国产一区二区| 亚洲曰韩产成在线| 欧美色网一区二区| 天堂va蜜桃一区二区三区漫画版| 欧美日韩国产小视频| 日本欧美久久久久免费播放网| 欧美丰满少妇xxxbbb| 蜜臀a∨国产成人精品|