阅 读 文 章

SCO提供的不相关进程间传递描述符的例子!!!

[来源:网上转载 (http://www.chinaunix.net) | 作者:网友(laikou2003) | 时间:2007-05-27 | 浏览:人次 ]


[color=blue]测试一下,没有问题。原来的程序有一点BUG,已经改正。[/color] :D 

named streams pipe /unix kernel example source code sample I_SENDFD I_FDINSERT ioctl af_unix
domain sockets socketpair pass file descriptor /dev/spx I_RCVFD openserver 5.0.0 5.0.2 faststart
1.0.0 1.0.1 full duplex bidrectional

Release 
SCO OpenServer Enterprise System Release 5.0.0, 5.0.2
SCO OpenServer Desktop System Release 5.0.0, 5.0.2
SCO FastStart Release 1.0.0, 1.0.1
SCO OpenServer Development System Release 5.0.0, 5.0.2
SCO Open Desktop Release 3.0
SCO Open Desktop Development System Release 3.0
SCO UNIX System V/386 Release 3.2 Development System Version 4.2 


How are the I_SENDFD and I_RCVFD ioctl()s properly used? -or- Is there an alternative to 
Unix Domain Sockets and passing file descriptors via "access rights" in sendmsg(SSC) and 
recvmsg(SSC) function calls, in SCO OpenServer 5? Is there a workaround to the current 
lack of support for Unix Domain Sockets in SCO Open Desktop Release 3.0?

The following source code consists of three files. These three files illustrate the proper 
use of the I_SENDFD ioctl(S). This provides a functionality similar to Unix Domain sockets 
and BSD-style stream pipes. In this example, the server process creates an unnamed streams 
pipe by performing open(S) on the streams cloning device /dev/spx twice, and calling the 
I_FDINSERT ioctl() function to link the two streams together, thus creating the two ends of 
the pipe. The mknod(S) system call is then used to attach the name "/tmp/nspipe.serv" to one 
of the file descriptors. This end is then connected to by the client process via open() of 
this file name. The client sends a well-known request byte over the pipe and is received by 
the server. The server then satisfies the request by sending an open file descriptor to the 
论坛热门帖子: [lch203] 写得蛮好的linux学习笔记(10-21)
[黑马制造] 学习java的30个目标(10-19)
[笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19)
[udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18)
[沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18)
TAG标签: 描述 例子 传递 进程 提供 相关 if fd exit return close

最新评论 共有0位网友发表了评论

发表评论

评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名:(注册)
密码:
验证码:
匿名发表

网站地图友情连接交流论坛网站投稿广告服务联系我们留言本站长统计
Some rights reserved: www.chmhome.com, 鄂ICP备07010232号 E-mail:chinakafei@live.com,QQ:552766
中国咖啡技术网(Chmhome):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.