资源简介
QNX官方源代码,从SVN上拉取的,方便学习用。
代码片段和文件信息
/*
* $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 $“);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-11-26 23:29 qnx\
文件 62 2007-11-07 08:18 qnx\Makefile
目录 0 2007-11-06 23:20 qnx\lib\
文件 130 2007-11-07 08:14 qnx\lib\Makefile
目录 0 2007-11-07 00:11 qnx\lib\asyncmsg\
文件 28 2007-11-07 00:11 qnx\lib\asyncmsg\Makefile
文件 2812 2007-11-07 00:11 qnx\lib\asyncmsg\_asyncmsg_handle.c
目录 0 2007-11-07 00:11 qnx\lib\asyncmsg\arm\
文件 127 2007-11-07 00:11 qnx\lib\asyncmsg\arm\Makefile
目录 0 2007-11-07 00:11 qnx\lib\asyncmsg\arm\a.be\
文件 24 2007-11-07 00:11 qnx\lib\asyncmsg\arm\a.be\Makefile
目录 0 2007-11-07 00:11 qnx\lib\asyncmsg\arm\a.le\
文件 24 2007-11-07 00:11 qnx\lib\asyncmsg\arm\a.le\Makefile
目录 0 2007-11-07 00:11 qnx\lib\asyncmsg\arm\so.be\
文件 24 2007-11-07 00:11 qnx\lib\asyncmsg\arm\so.be\Makefile
目录 0 2007-11-07 00:11 qnx\lib\asyncmsg\arm\so.le\
文件 24 2007-11-07 00:11 qnx\lib\asyncmsg\arm\so.le\Makefile
文件 2171 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_channel_create.c
文件 1999 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_channel_destroy.c
文件 5039 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_connect_attach.c
文件 1540 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_connect_attr.c
文件 2525 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_connect_detach.c
文件 1372 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_flush.c
文件 946 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_free.c
文件 3024 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_get.c
文件 953 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_malloc.c
文件 1736 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_priv.h
文件 2701 2007-11-07 00:11 qnx\lib\asyncmsg\asyncmsg_put.c
文件 753 2007-11-07 00:11 qnx\lib\asyncmsg\common.mk
目录 0 2007-11-07 00:11 qnx\lib\asyncmsg\mips\
文件 127 2007-11-07 00:11 qnx\lib\asyncmsg\mips\Makefile
............此处省略11111个文件信息
相关资源
- wrk内核详细源代码
- VxWorks完整源代码+学习资料
- 第一行代码第二版源代码.rar
- 电脑报十年珍藏版(1992-2001)
- 大话数据结构原书+源代码.zip
- SIM超分辨成像开源代码
- 深入理解OpenCV:实用计算机视觉项目
- QGC地面站源代码
- 商城微信小程序
- 辛小姐的店网上店铺源代码+数据库
- 基于qt的俄罗斯方块源代码
- 基于Proteus和Keil C[林立]教材与源代码
- 《TensorFlow实战Google深度学习框架(第
- 《逆向工程核心原理》源代码及书中
- 自己收集的汇编源代码,供大家学习
- 基于BP神经网络的数字识别系统源代码
- [Cadence高速电路板设计与仿真第6版—
- 中国象棋源代码
- opencv调用海康威视摄像头源代码内大
- iTween官网源代码
- 大漠插件 开源代码
- 电子商务购物系统 Axure Pro案例源代码
- 最全的OpenCV源代码
- 药店管理系统有源代码
- JPEG 图像压缩 源码 源代码 算法文档介
- 食谱网站源代码,食谱管理系统两个
- 农产品溯源信息管理系统系统源代码
- 《数据结构》算法实现及解析--高一凡
- Windows API开发详解:函数、接口、编程
- C编译器剖析PDF文档_UCC162.3源代码
评论
共有 条评论