1

I'm trying to understand Unix pipes, and I can't find any information about Solaris anonymous pipes, which are created with something like pipe(2).

As far as I know, this system call creates a buffer somewhere in kernel space, and links read and write ends with file descriptors using vfs and vnode (not sure about this part).

But what is that buffer created in kernel space? How is it implemented and what are the differences with usual array of bytes?

4

2 回答 2

0

最终答案(如果有人发现并感兴趣):在内核空间中创建的这个缓冲区是使用 STREAMS 实现的:(来源:在 illumos 门中的 fifonode.h,感谢 jamieguinan)

     struct msgb    *fn_mp;     /* message waiting to be read */
     struct msgb    *fn_tail;   /* last message to read */

有关 struct msgb(STREAMS 的一部分)的信息可以在 man msgb(9) 中读取。

于 2019-04-25T10:31:59.653 回答
0

考虑使用 Solaris 门。它们是整个 Solaris 中使用的快速 IPC 机制。您可以在 docs.oracle.com 上找到文档,并在博客和 Illumos-gate https://github.com/illumos/illumos-gate中找到许多示例

于 2019-04-25T21:42:51.517 回答