资源简介
qnx6.4.0源代码 亲测可用含makefile
代码片段和文件信息
/*
* $QNXLicenseC:
* Copyright 2007 QNX Software Systems. All Rights Reserved.
*
* You must obtain a written license from and pay applicable license fees to QNX
* Software Systems before you may reproduce modify or distribute this software
* or any work that includes all or part of this software. Free development
* licenses are available for evaluation and non-commercial purposes. For more
* information visit http://licensing.qnx.com or email licensing@qnx.com.
*
* This file may contain contributions from others. Please review this entire
* file for other proprietary rights or license notices as well as the QNX
* Development Suite License Guide at http://licensing.qnx.com/license-guide/
* for other information.
* $
*/
#include
#include
#include “asyncmsg_priv.h“
/* This is painful. We have to prepare receive buf and associate
* it with the chid so we will know where to receive
*/
int asyncmsg_channel_create(unsigned flags mode_t mode size_t buffer_size unsigned max_num_buffer const struct sigevent *ev int (*recvbuf_callback)(size_t bufsize unsigned num_bufs void*bufs[] int flags))
{
struct _asyncmsg_channel_context *acc;
int chid;
if ((acc = (struct _asyncmsg_channel_context *)malloc(sizeof(*acc))) == NULL) {
return -1;
}
memset(acc 0 sizeof(*acc));
if ((errno = pthread_mutex_init(&acc->mutex 0)) != EOK) {
free(acc);
return -1;
}
acc->recvbuf_cb = recvbuf_callback;
acc->max_num_buffer = max_num_buffer;
acc->buffer_size = buffer_size;
if ((acc->iovs = malloc(sizeof(iov_t) * max_num_buffer)) == NULL) {
free(acc);
return -1;
}
if ((chid = ChannelCreateExt(flags | _NTO_CHF_ASYNC mode buffer_size max_num_buffer ev NULL)) == -1) {
pthread_mutex_destroy(&acc->mutex);
free(acc->iovs);
free(acc);
return -1;
}
if (_asyncmsg_handle(chid _ASYNCMSG_HANDLE_ADD | _ASYNCMSG_HANDLE_CHANNEL acc) == NULL) {
asyncmsg_channel_destroy(chid);
free(acc->iovs);
free(acc);
return -1;
}
return chid;
}
__SRCVERSION(“asyncmsg_channel_create.c $Rev: 153052 $“);
相关资源
- 嵌入式实时操作系统μC/OS-II与eCos的
- 嵌入式实时操作系统在DATU中的应用
- 嵌入式实时操作系统μC/OS-II下通用驱
- 嵌入式实时操作系统μC/OS-II在ARM上的
- SAC型液压支架控制器检测平台的设计
- 嵌入式实时操作系统的RAM盘扩展
- 基于嵌入式实时操作系统的程序设计
- 嵌入式实时操作系统 uC/OS-II第二版
- 嵌入式实时操作系统μC/OS-III-原版书
- QNX SDP 6.6 BSP for the Freescale i.XM6 Solo X
- 移植在STM8上的实时操作系统uCOS
- 嵌入式实时操作系统ucos原理和实践
- UCOSII实时操作系统实验
- 任哲-嵌入式实时操作系统μCOS-II原理
- CooCox CoOS - 免费并开源的嵌入式实时操
- RTAI Linux实时操作系统原理剖析
- 低版本QNX源码-专供分析学习
- 嵌入式实时操作系统VxWorks及其开发环
- uCOS-III 嵌入式实时操作系统中文版.
- 嵌入式实时操作系统的多线程计算-
- 嵌入式实时操作系统μCOS-II邵贝贝.p
- 任哲的《嵌入式实时操作系统ΜcOS-Ⅱ
- 任哲嵌入式实时操作系统uCos-ii原理及
- 分布式嵌入式实时操作系统QNX
- 任哲《嵌入式实时操作系统uCOS-II原理
- 嵌入式实时操作系统uCOS-II》(第二版
- 嵌入式实时操作系统ucos-ii
- 邵贝贝《嵌入式实时操作系统uCOS-II》
- 嵌入式实时操作系统
- QNX 官方完全源代码 供学习参考 展开
评论
共有 条评论