Is it possible to have pipe between two child processes created by same parent (LINUX, POSIX)

后端 未结 3 1385
無奈伤痛
無奈伤痛 2020-12-01 13:02

I have multiple child \"forked\" by the same parent and I try to construct pipe connection between all these child processes like a linked list structure. Child

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 13:56

    Create all the pipes first, then spawn all the children with the appropriate pipe ends in FDs 0 and 1.

    As for waiting, just keep waiting until it returns -1.

提交回复
热议问题