Search code examples
unixpipesolarisanonymous-pipes

How exactly are anonymous pipes implemented in Solaris?


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?


Solution

  • Final answer (in case if anyone finds this and is interested): this buffer created in kernel space is implemented using STREAMS: (source: fifonode.h in illumos gate, thanks to jamieguinan)

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

    Information about struct msgb (part of STREAMS) can be read in man msgb(9).