[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 |
注册
个人空间
