qnx获取旧资源pipe理器的resmgr_context_t

qnx获取旧资源pipe理器的resmgr_context_t,第1张

概述qnx获取资源pipe理器的resmgr_context_t

我试图为qnx 6.6 over / proc / {pID} / as创build我自己的进程pipe理器。

但是我只需要改变一个 *** 作(io_open),所有其他 *** 作应该继续使用旧文件(/ proc / {pID} / as)。

我可以只是得到指针resmgr_context_t(从path或fd,在resmgr_attach之前)和所有其他 *** 作只是调用默认function?

这是我想要的例子:

创build一个JAR文件并运行在RaspBerry PI上

appassembler maven插件不会对生成的脚本设置“执行”权限

波科计时器示例

在Unix中启动和停止SAS Server 9.2

python上的opencv错误

resmgr_context_t* old_context; int my_lseek(resmgr_context_t *ctp,io_lseek_t *msg,RESMGR_OCB_T *ocb){ return iofunc_lseek_default(old_context,msg,ocb); }

C ++:如何检查没有扩展名的文件的types

.git文件夹跨平台?

两个date减去年龄

什么是好的工具来进行IO测量和发现linux上的瓶颈?

如何在连接之前插入新行?

您需要创建一个只为io_open注册函数的常规资源管理器,所有其他资源管理器 *** 作将过滤到堆栈中较低的资源管理器。

如果您希望消息将resmgr堆栈向下移动到其他注册的io_open回调,则从io_open回调中返回ENOENT,否则返回EOK。

为简洁起见,省略错误检查。

#include <errno.h> #include <stdio.h> #include <stddef.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <time.h> #include <sys/iofunc.h> #include <sys/dispatch.h> static resmgr_connect_funcs_t connect_funcs; static resmgr_io_funcs_t io_funcs; static iofunc_attr_t attr; int io_open (resmgr_context_t *ctp,io_open_t *msg,RESMGR_HANDLE_T *handle,voID *extra); int main(int argc,char **argv) { resmgr_attr_t resmgr_attr; dispatch_t *dpp; dispatch_context_t *ctp; int ID; // initialize dispatch interface dpp = dispatch_create(); // initialize resource manager attributes memset(&resmgr_attr,sizeof resmgr_attr); resmgr_attr.nparts_max = 1; resmgr_attr.msg_max_size = 2048; // initialize functions for handling messages iofunc_func_init(_RESMGR_CONNECT_NFUNCS,&connect_funcs,_RESMGR_IO_NFUNCS,&io_funcs); connect_funcs.open = io_open; // initialize attribute structure used by the device iofunc_attr_init(&attr,S_IFNAM | 0666,0); // attach to /proc/{pID}/as path,replace '1' with correct pID resmgr_attach(dpp,&resmgr_attr,"/proc/1/as",_FTYPE_ANY,_RESMGR_FLAG_BEFORE|_RESMGR_FLAG_DIR,&io_funcs,&attr); ctp = dispatch_context_alloc(dpp); /* start the resource manager message loop */ while(1) { if((ctp = dispatch_block(ctp)) == NulL) { perror("dispatch_block"); return EXIT_FAILURE; } dispatch_handler(ctp); } } int io_open (resmgr_context_t *ctp,voID *extra) { time_t tod; tod = time(NulL); printf ("%10d %-32s is being openedn",tod,msg->connect.path); return(ENOENT); }

总结

以上是内存溢出为你收集整理的qnx获取旧资源pipe理器的resmgr_context_t全部内容,希望文章能够帮你解决qnx获取旧资源pipe理器的resmgr_context_t所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/langs/1284196.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存